Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

You are designing a concurrency curriculum for 500 Java engineers. Should wait and notify still be taught, and what should the curriculum focus on to prevent incidents over the coming years?

Yes, but briefly: engineers should understand wait and notify well enough to read legacy code and to see why higher-level tools exist, not to write new code with them. The curriculum should focus on avoiding shared mutable state, immutability, java.util.concurrent, executors and virtual threads, and the memory model at the level of happens-before and safe publication rather than CPU details. It should be built around real incidents from our own systems, such as pool exhaustion, races in singletons and deadlocks, and a smaller group of reviewers should be trained more deeply for concurrency-sensitive code.

Why this question is asked

Training 500 engineers is a large investment, and concurrency is the topic where the gap between what people were taught and what prevents incidents is widest. Many courses still start from threads, wait and notify, and CPU caches, while most production incidents come from unbounded pools, shared mutable singletons and missing timeouts. Interviewers ask this at the twenty-year level to see whether we can design learning around outcomes. In this answer, we will decide the place of wait and notify, set out the core topics and why each one prevents incidents, explain how to teach the memory model at the right depth, use our own incidents as material, and plan a deeper track for reviewers.

1Start From the Goal: Fewer Incidents

Before choosing topics, we decide what success looks like. The goal is not that engineers can explain monitors in an interview; it is that over the next few years there are fewer concurrency incidents and they are diagnosed faster. That means teaching the decisions engineers make daily: whether to share state, which executor to use, how to bound and time out work, how to read a thread dump.

So each module is judged by one question: which class of incident does it prevent or shorten? Topics that do not answer that question get less time, however interesting they are.

2The Place of wait and notify

wait and notify should still be taught, but in about an hour, not a week. Engineers will meet them in older code and libraries and must be able to read them, spot the classic bugs, an if instead of while or notify instead of notifyAll, and understand that a monitor has a wait set.

More importantly, they are the best way to explain why higher-level tools exist. Writing a bounded buffer by hand, then replacing it with an ArrayBlockingQueue in one line, teaches respect for java.util.concurrent better than any slide. After that module, the rule is clear: new code uses BlockingQueue, CountDownLatch, CompletableFuture or structured concurrency, not raw wait and notify.

3The Core: Avoid Sharing, Then Use the Right Tools

The largest share of time goes to the habits that prevent most incidents. First, avoiding shared mutable state: stateless Spring beans, immutable objects and records, confining state to one thread or one request, and passing messages instead of sharing objects. Code that shares nothing cannot race.

Second, the tools for what must be shared or coordinated: concurrent collections, atomics, executors with bounded queues and rejection policies, timeouts on every wait and client, and virtual threads with their actual guarantees and limits. Each topic is taught with the failure it prevents, for example an unbounded cached pool under a slow downstream service.

A curriculum for 500 engineers
ModuleTimeIncident it prevents
Shared state, immutability, stateless beans4 hraces in singletons and caches
Executors, bounds, timeouts, virtual threads4 hpool and thread exhaustion
Memory model: happens-before, safe publication2 hstale reads, broken lazy init
Locks and deadlocks; reading thread dumps3 hdeadlocks, long stalls
wait/notify for reading legacy code1 hmisreading or copying old patterns
Our incidents: case studies2 hrepeats of known failures
Reviewer track (about 30 people)3 dayssubtle bugs passing review
Times are a starting point; adjust after the first cohorts.

4The Memory Model at the Right Depth

The Java Memory Model is often taught through CPU caches, store buffers and instruction reordering. That is fascinating, but it changes with hardware and does not help most engineers write correct code. What they need is the contract: a set of happens-before rules that tell them when one thread is guaranteed to see another thread's writes.

So we teach a handful of rules: unlocking a monitor happens-before the next lock of it; a volatile write happens-before every later read of that variable; starting a thread and joining it create happens-before edges; and properly constructed final fields are visible to all threads. Then we teach safe publication, the ways to hand an object to another thread so it is seen fully built, and the classic bug that breaks it, a non-volatile lazy singleton. That level is enough to reason about almost all application code.

5Teach With Our Own Incidents

Generic examples are easy to forget; incidents in systems the engineers work on are not. We collect the last few years of concurrency post-mortems and turn the best ones into exercises: the service that died because a slow partner API filled a cached thread pool, the singleton with a HashMap that occasionally lost entries, the deadlock between a library callback and client code, the batch job that pinned all common pool threads.

Each case is taught in the same shape: the symptom as it appeared, the thread dump or metrics, the root cause, the fix, and the rule that would have prevented it. Engineers practise reading real thread dumps, which is the most useful debugging skill in this area and rarely taught.

6A Deeper Track for Reviewers

Not every engineer needs to write lock-free code or understand lock implementation, but every team needs someone who can review concurrency-sensitive code. So a smaller group, perhaps one or two per team, about 30 people in all, gets a deeper track: the memory model in more detail, lock ordering and contention analysis, JFR and profiling, jcstress for testing concurrent code, and design reviews of real pull requests.

These reviewers are then named in the code review process for code that touches shared state, custom executors or locks. That makes the training pay off on every relevant change, and it gives the other 470 engineers someone to ask.

Step throughHow the programme runs and improves
  1. Baselinecount concurrency incidents and their causes
  2. Core course for all engineersshort modules, our own examples
  3. Reviewer track for about 30 peopledeeper topics, review practice
  4. Reviewers named on sensitive codeshared state, executors, locks
  5. Measure after 6 and 12 monthsincident count, time to diagnose
  6. Update modules from new incidents

6 steps in order. Play them, or step through them one at a time.

7Follow-up questions

How would you measure whether the curriculum worked?

By incidents rather than quiz scores: the number of concurrency-related incidents per quarter, their severity, and the time to diagnose them, compared with the baseline. We would also track leading signals, such as executor rules passing in the build and review comments from the reviewer group.

Would you teach virtual threads to everyone?

Yes, because they change everyday decisions. Engineers need to know that virtual threads make blocking cheap, that they do not limit concurrency, and that downstream resources still need bounds. Without that, the most common misuse is spawning unlimited work against a database with a fixed connection pool.

How do you keep the material current?

Each new concurrency incident is reviewed for whether it reveals a gap, and modules are updated at least once a year with JDK changes, such as structured concurrency becoming final. The reviewer group owns the content, which keeps it close to real code.

8Conclusion

In this answer, we designed a curriculum around fewer incidents rather than complete theory. wait and notify are taught briefly, so engineers can read legacy code and see why java.util.concurrent exists. Most time goes to avoiding shared mutable state, immutability, concurrent tools, executors, timeouts and virtual threads, with the memory model taught as happens-before and safe publication. Our own incidents provide the examples, and a smaller group of reviewers is trained more deeply and named on concurrency-sensitive code.

What to say in the interviewAbout 90 seconds aloud

Open with

I would keep wait and notify, but as a short module. Engineers will meet them in legacy code and need to read them and spot the classic bugs, and writing a bounded buffer by hand is the best way to show why BlockingQueue and the other java.util.concurrent tools exist.

Then, if they want more

But I would not want anyone writing new code with them. I would design the curriculum around the incidents we want to prevent.

Most of the time goes to avoiding shared mutable state, so stateless beans, immutable objects and thread confinement, and then to the right tools: concurrent collections, atomics, executors with bounded queues, timeouts everywhere, and virtual threads, including what they do not do.

The memory model I would teach at the level of happens-before rules and safe publication, not CPU caches, because that is what engineers need to reason about visibility. The examples would come from our own post-mortems, pool exhaustion from a slow partner, races in singletons, deadlocks, and engineers would practise reading real thread dumps.

Then a smaller group, one or two per team, would get a deeper track with JFR, lock analysis and jcstress, and be named as reviewers for concurrency-sensitive code. I would measure success by incident counts and time to diagnose, and update the material when new incidents show a gap.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "You are designing a concurrency curriculum for 500 Java engineers. Should wait and...": https://scrivio-interview-library.netlify.app/java/synchronization/7c90192a0e/