LLD Guide
How Cruscible's low-level design problems are graded, and the concurrency, Redis, Postgres and design skills they assume. Read it in order before your first problem.
By Cruscible Engineering ยท Published
Cruscible's LLD problems run your code against real infrastructure and a grader that calls it the way production would: in sequence, from many threads at once, and under load. Each problem assumes a few things you may not have practised yet.
Module 1, Foundations, covers them in five short lessons: how grading works, thread-safety, Redis, Postgres, and designing before you code. Read them in order.
Module 2, Problem prep, has one lesson per problem: what to decide before coding, the traps, and a checklist to keep. It never gives the solution away. Each problem page shows its checklist too.
Then follow the roadmap through the problems from easy to expert.
Module 1: Foundations
- 01.01 How Cruscible LLD Problems Work: Contracts, Graders and Scores โ Read this first. What the grader runs, what it scores, and what it ignores.
- 01.02 Thread-Safety Essentials for LLD Problems โ The five concurrency bugs graders catch, and the Java tools that prevent them.
- 01.03 Redis for LLD: The Right Data Structure, Atomically โ Five Redis patterns that cover almost every LLD problem, and why each needs to be atomic.
- 01.04 Postgres for LLD: Transactions, Row Locks and Idempotent Writes โ Let the database enforce your invariants, and your concurrency bugs mostly disappear.
- 01.05 State Machines and Invariants: Designing an LLD Solution Before You Code โ Draw the states, list the rules, then write the code. In that order.
Module 2: Problem prep
- 02.01 Prep: Retry Engine with Exponential Backoff โ The easiest problem to start with. What to decide before you write it, and what the brief quietly requires.
- 02.02 Prep: Employee Management System (In-Memory) โ CRUD looks trivial until you keep three indexes in step under concurrency, at sub-millisecond latency.
- 02.03 Prep: LRU Cache โ Two structures, one recency order, O(1) everything, and one method that must not touch the order.
- 02.04 Prep: Sliding Window Rate Limiter โ Shared state in Redis, one atomic decision per request, and data that cleans itself up.
- 02.05 Prep: Parking Lot System โ Spots, tickets and fees in Postgres, trucks that need two spots in a row, and no double-booking under load.
- 02.06 Prep: Priority Task Queue โ Highest priority first, FIFO among equals, exactly one consumer per task, and a dead-letter queue for the ones that keep failing.
- 02.07 Prep: Circuit Breaker โ Three states, a clock, consecutive failures, and a limited number of test calls, shared across instances in Redis.
- 02.08 Prep: Railway Reservation System โ Confirmed, RAC and waiting list, berth preferences, and a promotion chain that must stay FIFO and atomic.
- 02.09 Prep: Cab Booking System โ Rides, cabs and fares in Postgres, a three-step state machine, one winner when cabs race for a ride, and a nearby search that stays fast.
- 02.10 Prep: Load Balancer โ Four routing algorithms over shared Redis state, health-aware, at ten thousand calls a second.
- 02.11 Prep: URL Shortener โ Short codes that can never collide, clicks that are never lost, and long or Unicode URLs that come back byte for byte.
- 02.12 Prep: Deployment Pipeline Engine โ Ordered stages, one active deployment per pipeline, rollback and cancel, and a history that stays in order.