Multithreading

Concurrency, parallelism, and thread-safe programming, as they actually get asked in senior interviews.

Everything here answers one question wearing different costumes: who is allowed to proceed, and who tells them? Start with the 101 to get the vocabulary, learn the framework to get a repeatable method, then work the ten pattern families. The problems under each pattern are there to be solved, not read.

Start here

Patterns

Ten families cover every concurrency question I’ve seen asked. Each playbook has the mechanics, the derivation recipe, and the failure modes; each problem below it is a worked application.

Families 1 to 7 are the coordination core, learn these first and in order. Families 8 to 10 are the senior material: what correctness costs at scale, whether you can find someone else’s bug, and whether your instincts survive the process boundary.

The coordination core

The senior material

How to use this

Read the problem statement, close the page, and try it for 15–20 minutes in a blank editor. Only then read the strategy. The strategy pages deliberately contain no full solutions. They give you the invariant, the mental model, and the failure modes, so you reconstruct the code from understanding rather than recall. If you can’t rederive it a week later, you memorized it.

Two families break that loop on purpose. In Debugging & Code Review there is nothing to code first: the diagnosis is the deliverable, so work aloud from symptom to hypothesis to reproduction to fix before opening the strategy. In Distributed Concurrency these are spoken design answers: always give the single-JVM answer first, in code-level detail, and name its linearization point before you name any datastore. That ordering is itself part of what gets graded.

← Back to Interview Prep