Section 12: Two Numbers on a Whiteboard - Final Summary & Candidate Scorecard
Executive Summary: This closing section turns the module into an instrument you can score yourself with. We replay the interview arc as the signals each phase recorded, then lay out a 100-point scorecard whose cells carry this topic's own numbers and mechanisms. Score bands, three calibration rules and a catalog of isomorphs finish the job.
The prompt sounded like a WHERE clause, and most of the hour went into discovering that it isn't one. The interviewer wasn't waiting for you to say Cassandra or Redis. They were watching whether you noticed that Maya's ride, picked up at 16:52:10 and dropped off at 17:31:45, vanishes from the obvious query, and whether you could build a system that never loses her again at 30 million rides a day. Here is how that hour is scored.
The Arc, Replayed as Signal
Every phase produced an artifact you drew and a signal the interviewer wrote down.
Section 1 (Problem Understanding & Clarifications) and Section 2 (Requirements) fix the semantics: an event is [start, end), active iff start <= qe AND (end IS NULL OR end > qs), and ongoing rides count. Section 3 (Scale Estimation) turns Little's Law into a design input: 20,833 starts per minute times 20 minutes is about 417K active rides on average, about 1M at peak, small enough for about 0.3 GB of memory. Section 4 (API Design) and Section 5 (Data Modeling) show why one index can't bound two range predicates. Section 6 (High-Level Architecture) and Section 7 (Indexing Intervals) choose the structure with arithmetic. Section 8 (The Live Edge) and Section 9 (Interviewer Deep-Dive Challenges) prove correctness at the seam between tiers. Section 10 (Reliability) and Section 11 (Feature Evolution) show it survives breakage and growth.
Key Insight: No signal is "knows an exotic data structure." Interval trees, R-trees and GiST all came up and none won. The answer was boring storage partitioned by (city_id, bucket_start) plus a small in-memory set for open rides. What scores is choosing it with numbers: 2.33 rows per event, 1.6× overscan on the dominant query, against 29× for the bounded-duration trick.
Quick check before moving on:
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson