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

Interviewer: Design Google Docs — a real-time collaborative document editor. What do you want to clarify?

Candidate: Key questions:

  1. What document types — rich text only, or also spreadsheets and presentations?
  2. How many concurrent editors per document?
  3. What's the scale — documents and users?
  4. What's the core hard problem you want to focus on — conflict resolution, storage, or real-time sync?
  5. Offline editing support required?

Interviewer: Rich text documents only. Up to 100 concurrent editors per document. 1 billion documents total, 10 million active documents at any time, 50 million daily active users. Focus on conflict resolution and real-time sync. Offline editing required — changes must merge correctly when a user comes back online.

Candidate: The fundamental challenge is maintaining document consistency when multiple users edit simultaneously. If Alice inserts "Hello" at position 0 and Bob inserts "World" at position 0 concurrently, the final document depends on the order operations are applied — and different clients will see different results without a coordination protocol.

Key sizing: Operations/sec=50M users×10 keystrokes/min/60≈8.3M ops/sec\text{Operations/sec} = 50\text{M users} \times 10 \text{ keystrokes/min} / 60 \approx 8.3\text{M ops/sec}

But operations are bursty per-document. Active documents: Ops/sec per document (average)=8.3M10M active docs≈0.83 ops/sec\text{Ops/sec per document (average)} = \frac{8.3\text{M}}{10\text{M active docs}} \approx 0.83 \text{ ops/sec}

For a hot document with 100 concurrent editors, maybe 100 ops/sec — very manageable.

Interviewer: What are the core requirements?

Candidate:

  • Real-time collaborative editing — changes appear on all clients within 500 ms

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.