Skip to content
Sharp

Concurrency basics · interview question

Why do teams use ConcurrentHashMap over a standard HashMap in a multi-threaded environment in production code?

Multiple choiceEasychapter-15-curatedpremiumconcurrencyconcurrent-collections
Choose one answer
Answer and explanation

Correct answer

B. It uses multiple locks to improve performance under high concurrency.

Why

ConcurrentHashMap uses 'Lock Striping', which locks only a portion of the map, allowing higher concurrency compared to a standard HashMap that can become corrupted under concurrent modifications.

Test yourself on Concurrency basics

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

Start free test
All Concurrency basics questions →