InterviewStack.io LogoInterviewStack.io

Concurrency and Multithreading Questions

Principles and practical techniques for concurrent execution and safe access to shared state across threads or execution contexts. Topics include main thread versus background threads, dispatching and scheduling work, synchronization primitives, locks, atomic operations, avoiding deadlocks and race conditions, designing thread safe data structures, reactive and event driven approaches, and platform specific tools such as Grand Central Dispatch and OperationQueue on iOS or coroutines and LiveData on Android. Evaluations focus on reasoning about correctness, performance trade offs, and methods to prevent UI blocking and ensure responsiveness.

MediumSystem Design
51 practiced
Design an API and internal approach for cancellable tasks in a multithreaded service. How would you propagate cancellation, ensure resource cleanup, and handle cancellation of blocking I/O operations that are not interruptible by design?
EasyTechnical
66 practiced
Describe the difference between preemptive and cooperative multitasking. How do those models affect scheduling, responsiveness, and how you write concurrent code (e.g., explicit yielding vs relying on OS scheduler)?
MediumTechnical
53 practiced
Implement a read-write lock (RWLock) in Java or Python that allows multiple concurrent readers and exclusive writers. State whether your implementation supports reentrancy and fairness and how you would prevent writer starvation.
MediumTechnical
49 practiced
How do you systematically test concurrent code? Describe unit testing strategies, stress tests, fuzzing, use of sanitizers like ThreadSanitizer, and integration tests to catch races and deadlocks. Include approaches to reduce flakiness in CI runs.
HardTechnical
47 practiced
Explain priority inversion and design strategies to avoid it in real-time systems. Describe priority inheritance as a solution, its implementation implications, and show a code sketch of a mutex wrapper that supports priority inheritance semantics.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.