Skip to content
Sharp

Collections · interview question

What might cause a HashMap to degrade to O(n) performance for get() operations?

Multiple choiceHardchapter-4-curatedpremiumcollectionsmap-interface-and-hashmap
Choose one answer
Answer and explanation

Correct answer

D. All of the above

Why

All mentioned factors can contribute to a HashMap's performance degrading to O(n). A poor hash function and too many collisions can lead to linked lists forming within buckets, increasing retrieval time.

Test yourself on Collections

A free test with instant, explained results. No account needed.

Start free test
All Collections questions →