Synchronization Primitives and Inter Task Communication Questions
Master synchronization mechanisms: semaphores (binary, counting), mutexes, condition variables, and message queues. Understand when to use each primitive and their trade-offs. Discuss potential issues: priority inversion, deadlock, race conditions, and how to prevent them. Explain interrupt-safe synchronization. Discuss critical sections and atomic operations.
EasyTechnical
49 practiced
Explain condition variables: how they are used together with a mutex, why the condition check must be done in a loop to handle spurious wakeups, and common patterns such as producer-consumer or event waiting. Give an example of a bug caused by using notify() instead of notify_all() in a multi-waiter scenario.
HardTechnical
61 practiced
Explain the correctness and performance implications of replacing a futex-based mutex with a user-space optimistic spinning mutex that uses atomic CAS on the lock word and falls back to futex when contended. Analyze uncontended and contended paths, syscall frequency, CPU usage, and scenarios where this optimization is worthwhile or harmful.
EasyTechnical
67 practiced
What is a critical section and what are atomic operations? List common atomic primitives available in modern languages (for example: CAS, fetch-and-add, test-and-set) and give one SRE use case where using an atomic operation is preferable to a mutex.
MediumTechnical
63 practiced
Design an alert that detects elevated lock contention causing increased request latency for a web service. Specify which metrics you would collect (for example: mutex wait time histograms, syscall latency, queue sizes), how you would set thresholds, and include immediate runbook steps the on-call engineer should follow.
EasyTechnical
104 practiced
Define a race condition and provide a concise concrete example (pseudocode) where two threads increment a shared counter without synchronization. Explain the incorrect behavior that can result and list simple ways to fix it in production code.
Unlock Full Question Bank
Get access to hundreds of Synchronization Primitives and Inter Task Communication interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.