Interview Preparation
Concurrency Interview Mastery
A 14-module concurrency course narrated by Nikhil Joshi, Google distributed systems engineer who built payment infrastructure moving
00M/day at Razorpay.Concurrency Interview Mastery: Threading, Locking & System Design
Most engineers can write concurrent code. Very few can explain why it works.
Built and narrated by Nikhil Joshi - Google distributed systems engineer, formerly Razorpay where he designed payment infrastructure moving eight hundred crore rupees a day through concurrent code - this course teaches you the mental models, primitives, patterns, and interview communication skills that separate "Lean Hire" from "Strong Hire" in concurrency rounds.
Module 0 - Orientation (free): Why concurrency breaks interviews specifically - not because candidates don't know threads, but because they can't reason out loud about them under pressure.
Module 1 - Concurrency 101 (free): The theory you actually need. Concurrency vs parallelism. Processes vs threads. Race conditions and critical sections. Memory models. When NOT to go concurrent.
Module 2 - Your Language: Language-specific concurrency APIs for Java, Python, Go, C++, and C#. Each language gets its own section: thread creation, memory models, synchronization, and the modern high-level primitives (virtual threads, goroutines, asyncio, std::async).
Modules 3-6 - Core Primitives and Challenges: Mutex, semaphore, condition variables, read-write locks, barriers. Locking strategies - granularity, reentrancy, ordering. Lock-free programming with CAS and atomics. The failure modes - deadlock, livelock, starvation, priority inversion - and how to debug them in production.
Modules 7-11 - Patterns and Problems: The canonical concurrency patterns every interviewer expects. Every classic problem - bounded buffer, dining philosophers, sleeping barber, readers-writers - with full worked solutions. Design problems that appear in system design rounds: thread-safe caches, rate limiters, task schedulers, web crawlers. Concurrent data structures and multi-threaded algorithms.
Modules 12-13 - From Threads to Distributed and the Interview: The conceptual bridge from single-machine concurrency to distributed systems. How to talk about thread safety out loud, handle follow-up questions, and close a concurrency round with a Strong Hire signal.
Modules 0-1 are free to preview. The full course is a one-time purchase with lifetime access.
What you will learn
- The mental model that separates candidates who know concurrency from candidates who can reason about it out loud under interview pressure
- Language-specific concurrency APIs for Java, Python, Go, C++, and C# - each in its own section with thread creation, memory models, synchronization primitives, and modern async patterns
- Every core synchronization primitive in depth: mutex, semaphore, condition variable, read-write lock, barrier, monitor - what each is, how it works beneath the API, and when to use it
- Locking strategies - coarse vs fine-grained, reentrant locks, try-lock, optimistic vs pessimistic locking, two-phase locking, and lock ordering to prevent deadlock
- Lock-free programming: compare-and-swap, atomic operations, the ABA problem, memory ordering, and false sharing - the material that triggers the hardest follow-up questions
- Every classic concurrency failure mode: deadlock, livelock, starvation, lost signal, spurious wakeup, thread leakage, priority inversion - with production debugging strategies
- The canonical concurrency patterns: thread pool, producer-consumer, fork-join, future-promise, pipeline, scatter-gather, and double-checked locking
- All eleven classic concurrency problems (bounded buffer, dining philosophers, sleeping barber, readers-writers, and more) with complete worked solutions
- Design problems that appear in system design rounds: thread-safe TTL cache, rate limiter, deferred callback executor, ticket booking system, multithreaded web crawler, pubsub system, and task scheduler
- Concurrent data structures from scratch: concurrent hashmap, blocking queue, bloom filter, lock-free queue, priority queue, and trie
- How to reason about thread safety out loud in an interview - the language, structure, and follow-up handling that earns a Strong Hire signal
Prerequisites
- Comfortable with at least one of: Java, Python, Go, C++, or C#
- Basic understanding of functions, loops, and data structures
- No prior concurrency experience required - the course starts from first principles
Course outline
Module 1: Orientation
Orientation - 4 topics.
- I could build it. I just couldn't say it. 10 min read
- This course is meant to be watched and heard, not just read 6 min read
- The whole map, before we start walking 6 min read
- You shouldn't learn this alone 3 min read
Module 2: Concurrency 101
Concurrency 101 - 8 topics.
- "At the same time" is a lie - and it's the most useful lie in computing 11 min read
- Two words people use interchangeably - and shouldn't 10 min read
- The two ways to run code at once - and why the choice decides where your bugs live 10 min read
- A thread is almost never just "running" 10 min read
- The bug that only happens sometimes 10 min read
- There's more than one way to think about concurrency 10 min read Pro lesson
- The assumption that's quietly wrong 10 min read Pro lesson
- The most senior thing you can say is "let's not" 10 min read Pro lesson
Module 3: Your Language
Your Language - 5 language tracks.
- Java 1 min read Pro lesson
- Python 1 min read Pro lesson
- Go 1 min read Pro lesson
- C++ 1 min read Pro lesson
- C# 1 min read Pro lesson
Module 4: Synchronization Primitives
Synchronization Primitives - 11 topics.
- Mutex (Mutual Exclusion) 11 min read
- Exercise: Mutex (Mutual Exclusion) 7 min read
- Semaphores 10 min read
- Exercise: Semaphores 6 min read
- Condition Variables 10 min read
- Exercise: Condition Variables 6 min read
- Read-Write Locks 10 min read Pro lesson
- Exercise: Read-Write Locks 6 min read Pro lesson
- Barriers and Latches 10 min read Pro lesson
- Exercise: Barriers and Latches 6 min read Pro lesson
- Monitors 11 min read Pro lesson
Module 5: Locking Strategies
Locking Strategies - 11 topics.
- Coarse-grained vs Fine-grained Locking 10 min read
- Exercise: Coarse-Grained vs Fine-Grained Locking 6 min read
- Reentrant Locks 10 min read
- Exercise: Reentrant Locks 6 min read
- Try-Lock and Timed Locking 10 min read
- Exercise: Try-Lock and Timed Locking 6 min read
- Optimistic vs Pessimistic Locking 10 min read Pro lesson
- Exercise: Optimistic vs Pessimistic Locking 7 min read Pro lesson
- Two-Phase Locking (2PL) 11 min read Pro lesson
- Exercise: Two-Phase Locking (2PL) 6 min read Pro lesson
- Lock Ordering & Lock Hierarchies 11 min read Pro lesson
Module 6: Lock-Free Programming
Lock-Free Programming - 7 topics.
- Compare-And-Swap (CAS) 10 min read
- Exercise: Compare-and-Swap (CAS) 6 min read
- Atomic Operations 10 min read Pro lesson
- Exercise: Atomic Operations 6 min read Pro lesson
- The ABA Problem 11 min read Pro lesson
- Memory Ordering for Lock-Free Code 10 min read Pro lesson
- False Sharing & Cache Coherence 11 min read Pro lesson
Module 7: Concurrency Challenges
Concurrency Challenges - 9 topics.
- Deadlock 10 min read Pro lesson
- Exercise: Deadlock 6 min read Pro lesson
- Livelock 10 min read Pro lesson
- Starvation 10 min read Pro lesson
- Lost Signal / Wakeup 10 min read Pro lesson
- Spurious Wakeup 10 min read Pro lesson
- Thread Leakage 10 min read Pro lesson
- Priority Inversion 10 min read Pro lesson
- Debugging in Production: Thread Dumps & Deadlock Detection 10 min read Pro lesson
Module 8: Concurrency Patterns
Concurrency Patterns - 16 topics.
- The Signaling Pattern 10 min read
- Exercise: The Signaling Pattern 6 min read Pro lesson
- The Thread Pool Pattern 10 min read
- Exercise: The Thread Pool Pattern 6 min read Pro lesson
- The Producer-Consumer Pattern 10 min read
- Exercise: The Producer-Consumer Pattern 6 min read Pro lesson
- The Reader-Writer Pattern 10 min read
- The Future/Promise Pattern 10 min read Pro lesson
- Exercise: The Future/Promise Pattern 6 min read Pro lesson
- The Fork-Join Pattern 10 min read Pro lesson
- Exercise: The Fork-Join Pattern 6 min read Pro lesson
- The Double-Checked Locking Pattern 11 min read Pro lesson
- Double Checked Locking Pattern 6 min read Pro lesson
- The Pipeline / Staged Concurrency Pattern 10 min read Pro lesson
- The Scatter-Gather Pattern 10 min read Pro lesson
- Concurrency Patterns: Interview Questions 10 min read Pro lesson
Module 9: Classic Problems
Classic Problems - 21 topics.
- Print Foo Bar Alternately 10 min read
- Exercise: Print FooBar Alternately 5 min read Pro lesson
- Print Zero Even Odd 10 min read
- Exercise: Print Zero Even Odd 5 min read Pro lesson
- Fizz Buzz Multithreaded 10 min read
- Exercise: Fizz Buzz Multithreaded 6 min read Pro lesson
- Building H2O 10 min read
- Exercise: Building H2O 6 min read Pro lesson
- The Readers-Writers Problem 10 min read Pro lesson
- Exercise: The Readers-Writers Problem 5 min read Pro lesson
- The Unisex Bathroom Problem 10 min read Pro lesson
- Exercise: The Unisex Bathroom Problem 6 min read Pro lesson
- The Bounded Buffer Problem 10 min read Pro lesson
- The Sleeping Barber Problem 10 min read Pro lesson
- Exercise: The Sleeping Barber Problem 5 min read Pro lesson
- The Dining Philosophers Problem 10 min read Pro lesson
- Exercise: The Dining Philosophers Problem 5 min read Pro lesson
- The Cigarette Smokers Problem 10 min read Pro lesson
- Exercise: The Cigarette Smokers Problem 6 min read Pro lesson
- The Santa Claus Problem 11 min read Pro lesson
- Exercise: The Santa Claus Problem 6 min read Pro lesson
Module 10: Design Problems
Design Problems - 14 topics.
- Designing a Thread-Safe Cache with TTL 10 min read
- Exercise: Design a Thread-Safe Cache with TTL 5 min read
- Designing a Thread-Safe Rate Limiter 10 min read Pro lesson
- Exercise: Design a Thread-Safe Rate Limiter 5 min read Pro lesson
- Designing a Deferred Callback Executor 10 min read Pro lesson
- Exercise: Design a Deferred Callback Executor 5 min read Pro lesson
- Designing a Ticket Booking System 10 min read Pro lesson
- Exercise: Design a Ticket Booking System 5 min read Pro lesson
- Designing a Multithreaded Web Crawler 10 min read Pro lesson
- Exercise: Design a Multithreaded Web Crawler 5 min read Pro lesson
- Designing a Multithreaded Pub-Sub System 10 min read Pro lesson
- Exercise: Design a Multithreaded Pub-Sub System 5 min read Pro lesson
- Designing a Task Scheduler with Dependencies 11 min read Pro lesson
- Exercise: Design a Task Scheduler with Dependencies 6 min read Pro lesson
Module 11: Concurrent Data Structures
Concurrent Data Structures - 11 topics.
- Designing a Concurrent HashMap 10 min read
- Exercise: Design a Concurrent HashMap 6 min read
- Designing a Thread-Safe Blocking Queue 10 min read
- Exercise: Design a Thread-Safe Blocking Queue 6 min read
- Designing a Concurrent Bloom Filter 10 min read Pro lesson
- Exercise: Design a Concurrent Bloom Filter 6 min read Pro lesson
- Designing a Lock-Free Queue 11 min read Pro lesson
- Designing a Concurrent Priority Queue 10 min read Pro lesson
- Exercise: Design a Concurrent Priority Queue 5 min read Pro lesson
- Designing a Thread-Safe Trie 10 min read Pro lesson
- Exercise: Design a Thread-Safe Trie 6 min read Pro lesson
Module 12: Multi-threaded Algorithms
Multi-threaded Algorithms - 6 topics.
- Multi-threaded Merge Sort 11 min read
- Exercise: Multi-threaded Merge Sort 5 min read
- Multi-threaded Word Frequency Counter 11 min read Pro lesson
- Exercise: Multi-threaded Word Frequency Counter 5 min read Pro lesson
- Concurrent BFS/DFS Graph Traversal 11 min read Pro lesson
- Exercise: Concurrent BFS/DFS Graph Traversal 6 min read Pro lesson
Module 13: Threads to Distributed Systems
Threads to Distributed Systems - 2 topics.
- The Map: Single-Machine Concurrency → Distributed Coordination 11 min read Pro lesson
- Testing Concurrent Code 11 min read Pro lesson
Module 14: Interviewing on Concurrency
Interviewing on Concurrency - 3 topics.
- How to Talk About Concurrency Without Freezing 10 min read Pro lesson
- Reasoning About Thread-Safety Out Loud 11 min read Pro lesson
- The Follow-up Gauntlet 11 min read Pro lesson