InterviewStack.io LogoInterviewStack.io

Concurrency and Synchronization Questions

Covers the principles and practical techniques for safely coordinating concurrent execution and access to shared resources. Topics include models of concurrency such as threads, processes, interrupt handlers, and tasks in a real time operating system; differences between preemptive and cooperative scheduling; shared data hazards including race conditions and read modify write hazards; critical sections and approaches to protect them including disabling interrupts in embedded contexts and scoped locks. Synchronization primitives and patterns are included: mutexes, binary semaphores, counting semaphores, condition variables, message queues, atomic operations and lock free primitives such as compare and swap. Memory ordering concerns and memory barrier usage on multi core systems are covered, along with priority inversion and priority inheritance. Also addressed are deadlock, livelock, and starvation concepts and avoidance strategies, granularity and performance trade offs of locking, and practical synchronization patterns. Preparation should include identifying and fixing races in code, designing correct concurrent interfaces, and debugging and testing techniques such as stress testing, instrumentation, deterministic replay, race detectors, static analysis, and code review strategies.

MediumTechnical
0 practiced
Explain how Linux futexes (fast userspace mutexes) behave and why they are efficient for uncontended locks. As an SRE, when would you choose a user-space spin (busy-wait) vs a futex-backed mutex? Provide a short pseudo-implementation sketch showing a spin-then-futex policy.
MediumTechnical
0 practiced
During a release, an intermittent race causes data corruption in production. You're the on-call SRE: describe immediate mitigation steps to reduce customer impact, how you'd determine whether to rollback or patch, and practical steps to reconcile corrupted data if necessary.
MediumTechnical
0 practiced
In an embedded or kernel context, one common primitive is to disable interrupts to protect a short critical section. Describe the implications of disabling interrupts on latency and interrupt handling. Provide example pseudocode showing when disabling interrupts is appropriate and list three rules you would apply to keep the system responsive.
HardSystem Design
0 practiced
Design a locking strategy for a high-throughput distributed cache that must support 100k ops/sec and provide per-key strong consistency for writes. Discuss per-key locks versus shard-leader approaches, lease durations, failure modes, and how to minimize tail latency under heavy contention.
EasyBehavioral
0 practiced
Tell me about a time you participated in a post-incident review where a concurrency bug caused an outage. Describe your role, how you identified the root cause, what technical remediation you implemented, and what process changes you recommended to prevent recurrence.

Unlock Full Question Bank

Get access to hundreds of Concurrency and Synchronization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.