Lesson Overview + Section #01 + RESHADED Checklist + Quiz #1 are unlocked free below (no login required). Unlock all 80 HD video lessons and deep-dive sections — or watch our two free sample video lessons first.
Designing a proximity service like Yelp requires answering radial geospatial queries ("coffee within 2 km of (lat, lng)") across 200 million businesses in < 200 ms at 11,600 peak QPS. L4-L6 interviewers evaluate whether candidates recognize why relational BETWEEN range scans and uniform grids degrade under skewed urban density (50,000 POIs in downtown Manhattan vs. 3 in a forest), prove via byte-level math that a global density-adaptive Quadtree occupies only ~4.8 GB of RAM, and choose hash(place_id) scatter-gather sharding with read replicas over hot-spot-prone geographic partitioning.
WHAT YOU WILL MASTER IN THIS LESSON
Scope a read-dominated POI proximity service (11,600 peak search QPS vs. infrequent business edits, 200 GB place records, 300 GB/day photos) and justify relaxed eventual consistency (minutes) for index updates.
Architect a CQRS split separating relational source-of-truth writes (Primary DB + Blob Store) from a memory-first read path (In-Memory Spatial Index -> Popular Places Cache -> Read Replicas).
Compare SQL 2D B-trees, fixed grids, Geohashes, and dynamic Quadtrees (max 500 places/leaf, ~10 tree levels), deriving the exact ~4.8 GB RAM footprint for 200M places.
Contrast regional sharding against hash(place_id) sharding across replicated index nodes, including cold Quadtree rebuilds from the database on node failure.
Follow this exact sequence from the Intro narration on every system design prompt so you never miss requirements, math, contracts, or the 13-minute deep dive.
0 / 8 Checked
RRequirements & ScopeMin 2–8
Clarify who the users are, 3–4 core functional flows, explicit non-goals, and target latency/availability SLAs before drawing a single box.
Avoid trap: Still gathering requirements at minute 15 squeezes the deep dive where L5/L6 offers are decided.
EBack-of-the-Envelope MathMin 8–12
Compute ONLY numbers that actively change architectural choices: DAU → peak read/write RPS, daily & 5-year storage, bandwidth (or tokens/sec & KV-cache VRAM for AI).
Avoid trap: Spending 10 minutes multiplying irrelevant byte counts that never influence sharding or caching.
SStorage & Data ModelMin 12–15
Define core tables, primary/partition keys, and access indexes. Separate small structured metadata rows (~1 KB) from bulk binary blobs (S3 + CDN).
Avoid trap: Picking Cassandra or NoSQL by buzzword when 40 writes/s & 3 TB fit cleanly on one indexed SQL primary + replicas.
AAPIs & Wire ContractsMin 15–17
Write 3–4 concrete REST/gRPC/SSE/WebSocket endpoints with request/response shapes, cursor pagination, and Idempotency-Key headers on mutations.
Avoid trap: Hand-waving client-server contracts and discovering missing parameters halfway through the deep dive.
HHigh-Level DesignMin 17–27
Draw the simplest end-to-end working read and write paths first. Every box on the board must trace back to a stated requirement or number.
Avoid trap: Reciting a memorized 12-microservice Kafka mesh before proving why a simpler synchronous path breaks.
DDetailed Design (Deep Dive)Min 27–36
Proactively audit your high-level diagram, name the top 2 bottlenecks (hot partitions, fan-out skew, lock contention, GPU saturation), and go deep on internals.
Avoid trap: Waiting passively for the interviewer to rescue pacing or skimming every box at shallow surface depth.
EEvaluation & Failure ModesMin 36–41
State what each architectural choice COSTS you, and trace graceful degradation when cache, queue, external vendor, or primary DB fails.
Avoid trap: Assuming happy-path uptime or placing slow 3-second external calls inline on revenue-critical write paths.
DDistinctive FeatureMin 41–45
Solve the signature hard problem unique to this prompt (e.g., double-entry ledger idempotency, Geohash dispatch locks, OT/CRDT sync, or SSE token streaming).
Avoid trap: Spending 20 minutes on generic login/CRUD tables and zero time on the core distributed challenge.
INTERVIEWER SCORECARD · WHAT MAKES A STRONG HIRE?
5 Signals Bar Raisers Grade (L4 vs. L5 Senior vs. L6 Staff)
Senior (L5 / E5 / Senior SDE) Bar — Autonomous Pacing, Depth & Proactive Trade-Offs: Owns the 45-minute clock without prompting, derives every component quantitatively, surfaces failure modes (hot shards, stampedes, dual writes) BEFORE being asked, and defends consistency vs. latency trade-offs.
1. Scoping
✓ STRONG HIRE SIGNAL
Clarifies users, read/write skew, p99 latency, consistency bounds, and explicit non-goals in minutes 2–8.
✗ NO-HIRE RED FLAG
Jumps straight into drawing load balancers and microservices at minute 2 without asking a single question.
2. Right-Sized Design
✓ STRONG HIRE SIGNAL
Starts with the simplest working architecture justified by the math (e.g., 1 NVMe SQL primary + replicas + Redis for 40 writes/s & 3 TB).
✗ NO-HIRE RED FLAG
Recites a memorized Kafka + multi-DC Cassandra diagram that contradicts their own traffic calculations.
3. Technical Depth
✓ STRONG HIRE SIGNAL
Drives deep into 1–2 hard bottlenecks (partition keys, hot-key mitigation, transactional outbox, KV-cache batching) at minute 27.
✗ NO-HIRE RED FLAG
Skims across 12 boxes at identical buzzword depth and runs out of time before the deep dive.
4. Explicit Trade-Offs
✓ STRONG HIRE SIGNAL
Uses 3-part reasoning: 'A queue here because SMTP spikes to 3 s; checkout stays <60 ms, and we accept eventual email delay + retry dedup.'
✗ NO-HIRE RED FLAG
Name-drops tools ('We put Kafka and ZooKeeper here') without stating the alternative or operational cost.
5. Communication
✓ STRONG HIRE SIGNAL
Thinks aloud every 30–45s, checks alignment at phase transitions, and treats 'What if X fails?' as a cue for where points are awarded.
✗ NO-HIRE RED FLAG
Goes silent for 5 minutes while drawing or defends a flawed assumption defensively when nudged.
ARCHITECTURE & DATA-FLOW SLIDES · SLIDE 1 OF 1Section 01: System Design: Yelp
ARCHITECTURE / DATA FLOW DIAGRAM
SECTION 01 OF 4
1. System Design: Yelp
★ FREE PREVIEW
Key Takeaway: A proximity service is fundamentally an in-memory spatial indexing problem: pruning 200 million global places down to a few hundred radial candidates in single-digit milliseconds without ever scanning the full dataset.
ARCHITECTURE / DATA FLOW DIAGRAM
The Radial Proximity Query Problem
When a user opens Yelp or Google Places and searches for "coffee near me", the backend receives a center point (lat, lng), a search radius (e.g., 1,000 m), and an optional category filter, and must return matching businesses inside that circle ranked by distance, rating, and popularity. Across 200 million global places and thousands of concurrent searches per second, computing exact spherical (Haversine) distances against every row on disk takes seconds per request—requiring a spatial index that narrows the candidate set to a tiny local neighborhood in microseconds.
Bounding-circle filtering: Businesses within 1 km (cafe, bakery, pizzeria) qualify, while POIs 5-15 km away (museum, airport hotel) must be pruned without inspecting their records.
Multi-signal ranking & hydration: Qualifying candidates are scored by distance, average star rating (1-5), and review popularity, then hydrated with business names, hours, and photo thumbnails.
Strict interactive latency: Mobile discovery feels sluggish above 200 ms end-to-end, leaving < 20-50 ms for server-side spatial candidate retrieval.
Static POI Proximity vs. Real-Time Moving-Entity Tracking
In the opening minutes of a geospatial interview, strong candidates distinguish static POI proximity services (Yelp, TripAdvisor, hotel/gas-station finders) from high-churn moving-entity trackers (Uber nearby drivers, Find My Friends). Because restaurants and storefronts rarely change coordinates, the spatial index can optimize overwhelmingly for ultra-fast concurrent reads and apply structural edits asynchronously in batches.
Characteristic
Proximity Service (`Yelp` / Static POIs)
Real-Time Location Tracker (`Uber` Drivers)
Dataset Cardinality
~200 million static businesses
~5 - 10 million active moving vehicles
Coordinate Write Rate
Very low (thousands/day new/edited places)
Extreme (1 - 2.5 million GPS updates/s)
Read-to-Write Ratio
> 1,000 : 1 (overwhelmingly read-heavy)
~1 : 10 to 1 : 1 (write-dominated)
Ideal Index Update Strategy
Read-optimized Quadtree refreshed asynchronously every few minutes
Interview Signal: Clarifying Question Tip: Explicitly stating 'Because storefronts do not drive down the highway at 60 mph, we can optimize our spatial tree for lock-free reads and batch index mutations every few minutes' immediately earns Staff-level design credit.
SECTION 02 OF 4
2. Requirements of Yelp's Design
🔒 PRO SECTION
Key Takeaway: With 100M DAU generating 11,600 peak QPS over a 200 GB core Places dataset (plus 300 GB/day of photos), Yelp prioritizes high availability and < 200 ms search latency while relaxing index consistency to a few minutes.
Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.
Key Takeaway: Yelp employs a strict CQRS separation: writes land in a relational Primary DB (+ Blob Store for photos) as the single source of truth, while reads execute entirely in memory across Index Servers and a Popular Places Cache, falling back to Read Replicas only on cache misses.
Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.
Key Takeaway: A dynamic in-memory Quadtree (<= 500 places per leaf, ~10 levels deep, ~4.8 GB total RAM) solves urban/rural density skew, while sharding by hash(place_id) with read replicas eliminates regional hot spots and enables zero-downtime cold recovery.
Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.
In "System Design: Yelp" (Static POI Proximity vs. Real-Time Moving-Entity Tracking), how does a production-grade design handle "Coordinate Write Rate" (Real-Time Location Tracker (`Uber` Drivers))?