Design Real-Time Collaborative Text Editing With Operational Transformation

Last updated: November 29, 2026

Quick Overview

Design a collaborative document editor (in the style of an internal Meta docs or notes tool) where many people type in the same document at once, see each other's cursors, and always converge to the same text.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design a collaborative document editor (in the style of an internal Meta docs or notes tool) where many people type in the same document at once, see each other's cursors, and always converge to the same text.

Collaborative editing is a favorite deep-dive at Meta because it forces a precise discussion of concurrency and convergence. The interviewer checks that you can explain OT or CRDTs concretely, pick a server-ordered design, and handle reconnects, presence, and persistence.

What the Interviewer Expects
  • Choose OT with a central sequencer or a CRDT and justify it
  • Show a transform example for concurrent inserts
  • Handle client pending operations and acknowledgements
  • Persist an operation log with periodic snapshots
  • Sync cursors and presence separately from content
Key Topics to Cover
Operational transformation
CRDTs
WebSockets
Snapshots
Presence
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • What happens when a client reconnects after 10 minutes offline?
  • How do you scale to a document with 200 simultaneous editors?
  • How do you implement undo in a shared document?
  • How would you add comments anchored to text ranges?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: open a document, edit concurrently, see others' changes within ~100 ms, see cursors, work through brief disconnects, keep version history.

Non-functional: convergence (all replica...

High-Level Design
  • Clients keep a local copy, apply their own edits immediately, and send operations {base_rev, op} over a WebSocket.
  • Document session server: each active document is owned by one server (r...

Submit Your Answer
Markdown supported