Case Studies

Google Docs

Why last-write-wins silently loses data, and how Operational Transformation or CRDTs make concurrent edits converge.

19 minHardPluscase-studyreal-timeconsistency

Letting multiple users edit the same document at once, with every client converging on the same final content — widely known in interview prep as "the Google Docs problem," and a good vehicle for testing whether a candidate understands why "just take the last write" silently loses data the moment two people type at the same time.

What this lesson covers

Last-write-wins silently drops one of two concurrent edits. Use Operational Transformation: a central sequencing server transforms each incoming operation against those already applied so every client converges, with periodic snapshots; CRDTs are the offline-first alternative.

  • Two people typing at once is the whole problem: last-write-wins silently overwrites one user's keystrokes, which reads as data loss.
  • Every client must converge on the same final text without a central lock forcing users to take turns.
  • Applying operations in arrival order breaks because each was written against the same starting revision without knowing the other.
  • Name Operational Transformation or CRDTs by mechanism, not just by name, and know when each earns its cost.
  • Staff answers see the central sequencer as both the correctness guarantee and the scaling bottleneck, and shard by document.

Included in Plus and Pro

Continue reading “Google Docs

The full lesson works the design through end to end — diagrams, trade-offs, and what interviewers expect at each level. About 19 minutes.

  1. Understanding the Problem
  2. Functional Requirements
  3. Non-Functional Requirements
  4. Capacity Estimation
  5. Core Entities
  6. API Interface
  7. High-Level Design
  8. Trade-offs
  9. Final Design
  10. Operations & Observability
  11. Level Expectations
  12. Follow-Up Questions
  13. Try It Yourself