Collaborative Editing (Google Docs)

Let many users edit the same document simultaneously and converge on one result.

Hard50 minOT/CRDTWebSocketsVersioning

Collaborative editing like Google Docs lets many people type into the same document at the same time and see each other's changes within milliseconds, with everyone converging on an identical result. The heart of the problem is merging concurrent edits correctly, which is solved by operational transformation (OT) or CRDTs.

Clarify requirements

Functional

  • Create, open, and edit rich-text documents.
  • Multiple users edit concurrently; changes appear for others in real time.
  • Show collaborators' cursors and selections (presence).
  • Offline editing with sync on reconnect (at least for short disconnects).
  • Version history: view and restore earlier versions.
  • Sharing with view/comment/edit permissions.
  • Out of scope: spreadsheets, comment threads design details, export formats.

Non-functional

  • 100M DAU, 1B documents; most docs have 1–5 simultaneous editors, some up to ~100 (and many viewers).
  • Edit propagation latency < 200 ms within a region.
  • All replicas converge (strong eventual consistency); no lost keystrokes.
  • Durable: acknowledged edits survive server failures.

Try it first

Set a timer, sketch your own design on paper, then compare it with the reference walkthrough.

50:00

Defend it out loud

The AI interviewer will probe your design for Collaborative Editing (Google Docs) and score it.

Mock interview