All challenges
Code AnalysisBeginner 60s

Read-modify-write without atomicity

Two clients run this concurrently on value 5. What is the final value?
Starter code
v = cache.get("counter")   # both read 5
cache.set("counter", v + 1) # both write 6

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle