Skip to content
Sharp

Collections · interview question

Why do teams use a Map over a List in Java in production code?

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

Correct answer

C. Efficient key-value pair retrieval

Why

Maps are designed for efficient retrieval of values based on a unique key. This makes them ideal for scenarios where quick lookup by key is needed.

Test yourself on Collections

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

Start free test
All Collections questions →