Skip to content
Sharp

Concurrency basics · interview question

In which scenario might AtomicReference become insufficient for implementing a thread-safe data structure?

Multiple choiceHardchapter-15-curatedpremiumconcurrencyatomic-variables
Choose one answer
Answer and explanation

Correct answer

D. When multiple fields need to be updated atomically.

Why

AtomicReference can atomically manage a single reference, but it becomes insufficient when multiple fields need to be updated together atomically, as it lacks the ability to group multiple updates into a single atomic operation.

Test yourself on Concurrency basics

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

Start free test
All Concurrency basics questions →