Concurrency

A shop ledger page, 1899. Every line adds up.
LLD Series: Hotel Booking System - LLD
Design a hotel booking system: search availability for a date range, book rooms, cancel, and make sure the hotel is never overbooked even with concurrent requests. Support different pricing (weekend,...
11 min read
LLD Series: In-Memory Pub/Sub (Kafka-lite) - LLD
Design an in-memory publish-subscribe system. Publishers publish messages to topics; subscribers subscribe to topics and receive messages. Delivery should be asynchronous, a slow subscriber must not...
10 min read
LLD Series: BookMyShow (Movie Ticket Booking) (LLD)
Design a movie ticket booking system. Users browse shows, pick seats, pay and get a ticket. Two users must never book the same seat. The real question is concurrency: temporary seat holds with...
15 min read
LLD Series: Rate Limiter (Low-Level Design)
Typical phrasing: Design an API throttler, Limit 100 req/min per user, Implement token bucket. Asked at Visa/Mastercard (API gateway protection, card-network throttling), NPCI (UPI PSP throttling per...
13 min read
LLD Series: Digital Wallet (Low-Level Design)
Design a digital wallet (Paytm / PhonePe / PayPal style). Users can add money, transfer to other users, and view history. Make transfers safe under concurrent requests, idempotent on retries, and...
21 min read
LLD Series: Parking Lot (Low-Level Design)
Design a multi-floor parking lot. Vehicles enter, get a ticket and a spot, and pay on exit. Support different vehicle types and pricing. Write working code in 60 minutes.
15 min read
LLD Series: Java Concurrency Essentials for LLD Rounds
In fintech LLD rounds the follow-up is almost always: now make it thread-safe (two threads debit the same wallet, two users book the same seat, two requests carry the same idempotency key). Know the...
16 min read
Async Python for Experienced Developers: CPU-Bound vs IO-Bound Work
A practical guide to choosing asyncio, threads, or multiprocessing in Python, based on whether work is CPU-bound or IO-bound, with GIL basics.
4 min read
ThreadPoolExecutor Memory Blowup When You Submit a Million Futures
Why submitting a huge number of tasks to ThreadPoolExecutor exhausts memory, and how bounded submission, chunking, and as_completed keep usage flat.
4 min read