AppliedMultiple choice
When does a hash map lookup degrade to linear time?
- AWhen the table is more than half full of entries
- BWhen all the keys hash to the same bucket
- CWhen the keys are strings rather than integers
- DWhen the map is iterated rather than looked up directly
The worked solution is in Premium
The answer, the full working and the one idea to take away – for this and all 1,322 questions in the bank. Answer it in practice and your working is marked, with a known mistake named when you make one.
Learn the method
Reported in interviews at
More data structures and algorithms questions
- You insert 1,000 keys into a hash table with 1,000 buckets using a uniform hash.Applied
- You implement a queue with two stacks: push onto the inbox, and pop from the…Applied
- A root-finding guarantee, part 1 of 3Foundation
- You need the 100 largest values from a stream of 10⁹ numbers you cannot store.Foundation
- How many comparisons does a binary search need, in the worst case, over a…Foundation
- A balanced binary search tree holds one million keys.Foundation