Phase 1 — Clarify & Scope
Interviewer: Design Google Docs — a real-time collaborative document editor. What do you want to clarify?
Candidate: Key questions:
- What document types — rich text only, or also spreadsheets and presentations?
- How many concurrent editors per document?
- What's the scale — documents and users?
- What's the core hard problem you want to focus on — conflict resolution, storage, or real-time sync?
- 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:
But operations are bursty per-document. Active documents:
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