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. Covers synchronization primitives (locks, mutexes, semaphores, condition variables), atomic operations and memory ordering, avoiding deadlocks, race conditions, and livelocks, designing thread safe data structures, thread pools and work scheduling, and asynchronous or event driven execution models such as coroutines, futures and promises, and reactive streams. Also covers platform and language specific concurrency tools, for example java.util.concurrent and POSIX threads on backend systems, Grand Central Dispatch and OperationQueue on iOS, coroutines and structured concurrency on Android/Kotlin, and async/await models in other languages. Evaluations focus on reasoning about correctness under concurrent access, performance trade offs (throughput, latency, contention), and preventing blocking of latency sensitive execution paths (server request handlers, UI threads, game loops) to maintain responsiveness.

EasyTechnical
55 practiced
Explain practical steps you would take to reproduce, isolate, and fix a concurrency bug that only appears under heavy load on real devices. Include instrumentation, logging, deterministic reproductions, and mitigation strategies for production.
EasyTechnical
53 practiced
Explain thread confinement and how it helps avoid locks and race conditions in mobile apps. Provide two examples: one for confining state to the main thread and one for confining state to a dedicated serial background queue.
HardTechnical
60 practiced
A concurrency bug occurs only in release builds on a specific device and cannot be reproduced in debug. Outline a systematic debugging strategy to reproduce, diagnose, and fix such a heisenbug. Include compiler optimizations, timing differences, instrumentation trade-offs, and methods for capturing traces on-device.
HardTechnical
53 practiced
You have a callback-based SDK that performs a sequence of dependent async operations using nested callbacks. In Kotlin, refactor and implement a coroutine-based pipeline using suspend functions and structured concurrency so the sequence is sequential in code but runs asynchronously, and errors propagate properly to the caller.
EasyTechnical
51 practiced
Describe the core concepts of Grand Central Dispatch (GCD) on iOS: serial vs concurrent queues, global queues, dispatch_async vs dispatch_sync, and main queue. Explain typical usage patterns and pitfalls when dispatching work between queues.

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.