Skip to content
Sharp

Concurrency basics · interview question

How does ConcurrentHashMap improve performance over Collections.synchronizedMap in a high-concurrency setting?

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

Correct answer

C. By utilizing lock striping or node-level locking.

Why

ConcurrentHashMap uses lock striping, which means it locks only a portion of the map for updates, unlike Collections.synchronizedMap which locks the entire map.

Test yourself on Concurrency basics

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

Start free test
All Concurrency basics questions →