Tag
#concurrency
13 articles tagged concurrency.
Concurrency Patterns: The Reusable Shapes for Safe Multithreaded Design
Concurrency patterns explained: producer-consumer, thread pool, future, read-write lock, thread-safe singleton, and a semaphore-bounded pool for safe multithreaded design.
Cab Ride Allocator: a Concurrency Barrier Problem (the Uber ride question)
The Uber ride concurrency interview question: seat ride-request threads into cabs of four — 4+0, 0+4, or 2+2 only — with a mutex, two semaphores, and a barrier. Deadlock-free, stress-tested.
Ride Sharing HLD: Finding the Nearest Driver Without Asking All of Them
A ride sharing system design (Uber/Ola-style): the geospatial cell index that finds nearby drivers fast, the driver offer as a hold with a TTL, the double-match race, and surviving a hot region.
Movie Ticket Booking HLD: The Seat Hold Is the Whole System Design
A movie ticket booking system design (BookMyShow-style): the data model, a seat-hold with a TTL, stopping double-booking with an atomic update, and idempotent payment at scale.
Web Crawler LLD: A Frontier, a Seen-Set, and the Trick Question of When You're Done
A low-level design walkthrough of a web crawler core: the frontier queue, URL normalization before deduplication, a shared seen-set, per-host politeness, and termination by in-flight count.
Online Voting LLD: The Design Where You Destroy the Join on Purpose
A low-level design walkthrough of an online voting system: separating eligibility from the ballot so one vote per voter never links who voted to what, with an append-only, recountable tally.
Internet Download Manager LLD: Byte Ranges, Parallel Couriers, and a Crash-Proof Journal
A low-level design walkthrough of a download manager: splitting a file into byte-range segments, downloading them in parallel with retries, and resuming after a crash from an on-disk journal.
Thread Pool LLD: Build ExecutorService's Heart by Hand
A low-level design walkthrough of a thread pool: the bounded work queue, the worker loop that must never die, saturation and rejection, and the graceful shutdown promise — fully tested.
Inventory Management LLD: The Oversell Bug and the Reserve That Kills It
A low-level design walkthrough of an inventory management system: on-hand vs reserved vs available, two-phase reservations with commit and release, and the race that double-sells the last unit.
Building a Rate Limiter: The Low-Level Design
A low-level design walkthrough of a rate limiter: the token bucket class, the race condition that breaks it, making it thread-safe, a per-client registry, and the complete implementation.
Multithreading, Explained: From First Thread to Interview Favourites
A friendly tour of multithreading: threads, race conditions, synchronized, wait/notify — then the classic interview questions, odd-even printing, producer-consumer and deadlocks, solved and explained.
Designing a Thread-Safe LRU Cache
A low-level design walkthrough of an O(1) LRU cache — a hash map plus a doubly linked list — how eviction works, the locking story, and the full browsable implementation.
Designing a Rate Limiter
The system design classic: where a rate limiter sits in your architecture, fixed window vs sliding window vs token bucket, going distributed with Redis, and a thread-safe core you can ship.