Concurrency interview questions
100 Backend Engineering practice questions. Read what a strong answer covers, then practise it out loud against the clock.
Practise Concurrency questionsBeginner
- A counter is wrong under load
- Accidentally sequential async code
- Application hangs randomly
- Async code that is not actually concurrent
- Atomic operations
- Avoiding shared mutable state
- Blocking vs non-blocking I/O
- Concurrency vs parallelism
- Context switching cost
- Corrupted in-memory cache
- CPU-bound vs I/O-bound work
- Fire-and-forget tasks get lost
- Futures and promises
- Goroutines and channels
- Immutability and thread safety
- Java virtual threads
- Making independent calls in parallel
- Node.js server freezes under load
- Producer-consumer pattern
- Python's Global Interpreter Lock
- Reentrant locks
- Request stuck waiting on a lock
- Server stops responding but CPU is low
- Shared formatter gives wrong dates
- The event loop
- Threads vs processes
- Too many parallel calls to a partner API
- What a deadlock is
- What a mutex or lock does
- What a race condition is
- What a semaphore is
- What async/await does
- What thread-safe means
- Why use a thread pool
Intermediate
- Back-pressure inside a service
- Blocking call in a reactive pipeline
- Buffered vs unbuffered channels
- Calling async code from sync code
- Cancellation in concurrent code
- Compare-and-swap
- Concurrent collections
- Coroutines
- CPU work in an async Python service
- Errors silently disappear in async code
- Goroutine count keeps growing
- Lazy initialisation race
- Lock contention slows the service
- Many threads computing the same value
- Memory visibility between threads
- More threads made it slower
- Moving from thread-per-request to async
- Multi-process servers
- Optimistic vs pessimistic concurrency in code
- Processing a large list with limited concurrency
- Reactive programming
- Read-write locks
- Retries multiply concurrency
- Same request processed twice concurrently
- Scheduled job runs overlap
- Sizing thread pools for I/O-bound work
- Starvation and livelock
- Structured concurrency
- The actor model
- Thread-local storage
- Transfer method deadlocks
- User data leaking between requests
- Waiting forever for a result
Experienced
- Adaptive concurrency limits
- Adopting Java virtual threads
- Async processing breaks ordering
- Async service exhausts database connections
- Async service memory spikes under load
- Async service overwhelmed by its own speed
- Batching concurrent requests
- Choosing a concurrency model for a new service
- Choosing coordination for a singleton job across instances
- Context propagation in async code
- Deadlock between app lock and database lock
- Diagnosing event loop lag in production
- False sharing
- Fan-out with early cancellation
- Global lock limits throughput
- Graceful shutdown with in-flight work
- Happens-before relationships
- High-performance concurrency patterns
- Hot-reloading configuration safely
- Local locks in a distributed system
- Memory grows with unbounded executor queue
- Metrics counters slowing down hot path
- Priority inversion
- Race condition in a wallet service
- Rare corrupted data in a Go service
- Reviewing concurrent code
- Software transactional memory
- Speeding up CPU-heavy Python code
- Testing concurrent code
- The ABA problem
- Thread pool starvation in async frameworks
- Two workers process the same message
- Work-stealing schedulers