CONCURRENCY PRACTICE PATH
Concurrency interview problems
Concurrency interviews test whether behavior remains correct when operations overlap. This path starts with one shared invariant and progresses toward scheduling and transactional workflows.
For each problem, define the safety rule before choosing a lock or coordination primitive. Use custom cases to make interleavings, duplicate operations, and boundary conditions visible.
- Problems
- 9
- Languages
- Java · Python · C++
- Format
- Implementation
WHAT THIS PATH BUILDS
Practice the decisions behind working code.
- Identify the state that must change atomically and the invariant it protects.
- Distinguish mutual exclusion from coordination, ordering, and capacity control.
- Define idempotency and transaction boundaries before adding retries.
- Write deterministic tests for behavior that is otherwise timing-sensitive.
RECOMMENDED SEQUENCE
Build the skills in order.
Complete one section before moving to the next level of complexity.
01 Protect shared state
Start with compact state where the atomicity boundary and expected result are easy to inspect.
02 Coordinate work and scheduling
Move from isolated updates to ordering, assignment, cancellation, and capacity decisions.
03 Preserve transactional behavior
Finish with workflows where multiple state changes must succeed, fail, or retry as one coherent operation.
COMMON FAILURE MODES
Review these before you submit.
- Adding a lock without defining which state or invariant it protects.
- Holding locks while calling policies or other code that may block or re-enter.
- Using sleeps as proof of correctness instead of controllable coordination.
- Testing only the successful path and ignoring cancellation, expiry, or duplicate work.