All challenges
Code AnalysisHard 60s

Lost update from read-modify-write

Final balance is 150 instead of 180. This is:
Starter code
-- T1 and T2 run concurrently
SELECT balance FROM accounts WHERE id=1;  -- both read 100
UPDATE accounts SET balance = 100 + 50 WHERE id=1;
UPDATE accounts SET balance = 100 + 30 WHERE id=1;

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