15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.
Two workers can read the same counter before either writes. Both compute one, and the final value becomes one instead of two. The deterministic example models the interleaving without relying on a race to happen by chance. Identify the shared state and the operation that must be atomic or protected.
Practice and evidence: Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.
counter=0
a=counter
b=counter
counter=a+1
counter=b+1
print(counter)
Expected result: 1
Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.