Capacity Planning
Design the core of a ride-hailing service: drivers continuously report their location, and when a rider requests a ride, the system finds nearby available drivers and matches one.
In scope: location updates, finding nearby drivers, matching one without double-booking, and driver availability. Ride state, payments, and the trip lifecycle are a separate stateful service.
Scale and usage:
The numbers establish that writes dominate and the index is small enough to live in memory. Illustrative anchors.
2.1 The write firehose
At 5M active drivers each updating every 4 seconds, that is 5M ÷ 4s ≈ 1.25M location writes/sec. This is the headline number and the reason the index lives in memory.
2.2 Reads and memory
Ride requests peak around 50K/sec — roughly 25× fewer than writes, the inverse of most systems. The live state is about 500 MB — 5M drivers × 100 bytes — small enough to keep in RAM, sharded across cell-owning nodes. Durability isn't needed: a lost shard refills within one update interval as drivers re-report.
Key idea. 1.25M writes/sec versus 50K reads/sec; 500 MB of live state — writes dominate, the index is small and rebuildable.
What a strong answer sounds like
State the decision, connect it to a requirement, and name the tradeoff. Ask the interviewer for any product facts you need (users, usage, scale, targets) — they will answer. Keep the design focused on the workload.
The AI interviewer asks about this part of Design Uber / Nearby Drivers. The interviewer guides you through topics one by one.