Concurrency Interview

Questions with a beginner / strong / expert ladder, the signals interviewers actually listen for, and the follow-up that separates recall from understanding.

Area
Level

Questions

18
Concurrency or Parallelism?Beginner

What is the difference between concurrency and parallelism, and can you have one without the other?

Why Is counter++ Not Safe?Beginner

Two threads each run `counter++` a million times on a shared integer. The final value is less than two million. Explain exactly why, and what your options are.

When Do You Reach for a Mutex?Intermediate

When do you use a mutex, and how do you decide what goes inside it?

Async or Threads?Intermediate

When would you choose async/await over threads, and when would you choose threads?

How Does a Deadlock Happen, and How Do You Stop It?Intermediate

Walk me through how a deadlock occurs and how you would prevent one in a system with several locks.

Will More Threads Make It Faster?Intermediate

A service is slow. Someone suggests doubling the thread count. Will that make it faster?

Race Condition or Data Race?Advanced

What is the difference between a race condition and a data race? Can you have one without the other?

What Does an Atomic Actually Make Atomic?Intermediate

You replace a mutex-protected integer with an atomic. What have you gained, and what have you not?

Will the Other Thread See What I Wrote?Expert

Thread A writes a struct and then sets a flag. Thread B sees the flag and reads the struct. What can go wrong?

How Do You Size a Thread Pool?Advanced

How many threads should a pool have?

What Happens When the Producer Is Faster Than the Consumer?Intermediate

A producer generates work faster than a consumer can handle it. What are your options, and what does each cost?

What Happens When Nobody Wants the Answer?Advanced

A client disconnects while their request is being processed. What should happen to the work in flight?

Is Lock-Free Faster?Expert

Someone proposes rewriting a contended queue as a lock-free structure for performance. How do you respond?

Why Is Eight Cores Not Eight Times Faster?Advanced

You parallelise a job across eight cores and get a 3x speedup. Why, and what do you do about it?

What Does the GIL Actually Prevent?Intermediate

What is the GIL, and what does it mean for concurrency in Python?

What Stalls an Event Loop?Intermediate

Every endpoint on a Node service gets slower at the same time, including a health check that does nothing. What do you look for?

Optimistic or Pessimistic Concurrency Control?Advanced

Two users edit the same record. Would you use optimistic or pessimistic concurrency control, and how do you decide?

Two Independent Counters, No SpeedupExpert

Four threads each increment their own counter in an array. There is no lock and no shared variable, and the parallel version is slower than the sequential one. Why?

Universal signals

What strong concurrency reasoning sounds like, independent of the question.

The reliable tell is whether someone names the shared state and the invariant before naming a primitive. "I'd add a mutex" is an answer about an API; "the invariant is that the balance never goes negative, and the check and the decrement have to be atomic together" is an answer about the problem.

The full green and red flag sheet →