Perguntas de entrevista para o cargo de intern compartilhadas pelos candidatos
How to save resources' IDs used by an activity and access them in O(1), assuming there could be an infinite number of resources?
That took me a lot of time thinking, since, as far as I knew, that was impossible. It turned out that the answer he expected was using Hash Tables. I know that usually it works well and somewhere near O(1) but the worst case is still O(n), and as I was being probably more theorical than needed, it didn't lead me to the correct approach.
Can you give us an example?