Skip to content
Sharp

Java Threading · interview question

Which rule is strongest for enforcing inventory correctness across multiple application instances?

Multiple choiceHardchapter-15-curatedpremiumjava-threadingrace-conditions
Choose one answer
Answer and explanation

Correct answer

A. A conditional database update such as UPDATE... WHERE stock >=?

Why

When stock truth lives in the database, the final invariant must be enforced there. Conditional updates or transactional constraints work across all app instances, not just one JVM.

Test yourself on Java Threading

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

Start free test
All Java Threading questions →