InterviewStack.io LogoInterviewStack.io

Concurrency, Synchronization & Deadlock Questions

Coordinating concurrent execution against shared state: mutexes, semaphores, condition variables, spinlocks, and atomic operations, plus the problems they solve and cause. Covers race conditions, critical sections, the classic deadlock conditions and prevention/avoidance strategies, priority inversion, and livelock at the OS level.

HardTechnical
50 practiced

Multiple microservices have circular dependencies and during a rolling deployment you observe availability loss because service A waits on B and B waits on A. Design a deployment and synchronization strategy to avoid such deadlocks or availability gaps during concurrent upgrades. Address schema migrations, API compatibility, orchestration, and automated safety checks.

EasyTechnical
57 practiced

Explain what a semaphore is, including the difference between binary and counting semaphores, the typical operations (wait/P and signal/V), and at least two realistic SRE use cases (for example, limiting concurrent database connections or coordinating access to a pool). Mention fairness and common pitfalls when using semaphores in production systems.

MediumSystem Design
58 practiced

Design a distributed counting semaphore using Redis or ZooKeeper to coordinate access to a limited external resource among many clients. Describe how you would implement acquire/release, handle client crashes or lease expirations while holding permits, and discuss fairness and performance trade-offs.

MediumTechnical
65 practiced

How can heap and CPU profiling help diagnose synchronization bottlenecks such as hot locks or contention hotspots? Describe the metrics to look for, how to attribute time blocked on locks to call stacks, and name Linux and language-specific tools you would use in production to gather this information with minimal overhead.

EasyTechnical
46 practiced

Explain what a spinlock is, how it differs from a blocking mutex, when spinlocks are a good choice (short critical sections, multi-core), and what risks they pose on single-core systems or in preemptible environments.

Unlock Full Question Bank

Get access to all Concurrency, Synchronization & Deadlock interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.