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.
How would you reproduce and debug a heisenbug that only appears when a concurrent endpoint-monitoring service is under heavy load? Include your plan for stress testing, deterministic replay, instrumentation, and race detectors, and explain how you would narrow the fault to a specific interleaving.
Your team is building a concurrent secret rotation system for API keys and certificates. Readers must never observe mixed old-and-new state, rotations must be atomic from the caller's perspective, and downtime is not acceptable. Propose an approach and discuss its failure modes, rollback strategy, and observability.
Implement a thread-safe sliding-window rate limiter in C++ for login attempts. It must support many concurrent callers, keep the hot path fast, and return allow or deny for each request. Explain your data structures and synchronization strategy, including how you would expire old entries.
What is the difference between preemptive and cooperative scheduling, and why does the distinction matter when you are designing an embedded security monitor or RTOS-based intrusion detector?
Why do memory ordering issues matter on multi-core systems even if your code appears correct in a single-threaded test? Relate your answer to publishing updated security policy data to worker threads.
Unlock Full Question Bank
Get access to all 31 Concurrency, Synchronization & Deadlock interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.