Start Here

Tier 1 · Building Blocks

Scale Reads

Scale Writes

Database Selection

Traffic Control

Consistency & Coordination

Estimation

Tier 2 · Core Systems

Tier 3 · Location & Real-Time

Tier 4 · Infrastructure & Data

Tier 5 · Finance & Commerce

Tier 6 · Advanced & Collaborative

Phase 1: Clarify, Scope & Constraints


Interviewer: "Let's design a 'Nearby Friends' feature — like Facebook's. Users can opt in to share their real-time location and see which of their friends are physically nearby. How do you approach this?"

Candidate: "Interesting — this combines real-time location tracking, a social graph, and privacy controls. Let me clarify the core user journeys:

  1. Enable journey — User opts into location sharing; their phone starts sending location updates to the server
  2. Discovery journey — User opens the app and sees a list of friends who are currently nearby (within N km), with approximate distances ('~0.5 km away', '~2 km away')
  3. Privacy journey — User can pause sharing, set a 'ghost mode', or choose which friends can see them
  4. Notification journey — User receives a push notification when a specific friend enters their vicinity

The dominant complexity is real-time location at social graph scale. With millions of users simultaneously sending location updates every 30 seconds, and then computing 'which of my friends are near me' in near-real-time — the write throughput and the per-user spatial query are both significant challenges.

WHY: The secondary complexity is privacy. Broadcasting precise GPS coordinates to your friends violates user trust. We must show approximate locations (fuzzy to ~100m) and make the entire feature opt-in with granular controls.

Non-goals for V1:

  • Turn-by-turn navigation to a friend's location
  • Location history / replay ('where have you been')
  • Group location sharing for events
  • Persistent location storage (GDPR compliance requires ephemeral data)
  • Location-based ads

Interviewer: "What's the acceptable…

In the full tutorial

  • Phase 2: High-Level Architecture
  • Phase 3: Deep Dive & Evolution
  • Phase 4: Robustness & Operations

Glossary history

Click dotted jargon to save explanations here.