Collaborative Editor — Interview Perspective
'Design Google Docs' and 'Design Figma Collaboration' are really the same interview question wearing different names, and strong candidates signal that by quantifying concurrency and reasoning from a single-user editor toward collaboration rather than naming OT or CRDT first. This page covers how to structure the answer, what strong candidates emphasize, which mistakes to avoid, how to evolve the architecture live, and how to answer the deeper follow-up questions that separate a good answer from a great one.
Interview Structure
The best answer evolves the architecture live: single editor → multi-user conflicts → WebSockets → OT/CRDT → presence → version history → offline editing → sharded production architecture. Do not jump straight to the final diagram.
Recommended time allocation
5 min — Requirements clarification: text vs structured canvas, expected concurrency, offline support, history expectations, and presence fidelity. 5 min — Capacity estimation: concurrent documents, editors per doc, operations/sec, and WebSocket Gateway connection count. 7 min — Naive design: one user editor plus durable save. 7 min — Evolve to collaboration: add multi-user editing, sockets, authoritative Document Server, and Synchronization Engine. 7 min — Add conflict resolution: explain Operational Transform and mention CRDT as an alternative. 5 min — Add collaboration richness: Presence Service, cursors, Version Store, and offline replay. 4 min — Reliability and scale: hotspots, reconnect storms, lost operations, and shard routing. 5 min — Final recap: walk the production architecture and why each layer was earned.
Editorial note: this guidance is the author's synthesis of common system-design interview practice, not any specific company's rubric or interviewer feedback.
What Strong Candidates Do
Strong candidates do not just say 'use OT' or 'use WebSockets.' They explain what system pressure created each component.
Strong signals
- Quantify connections, concurrent docs, edit rate, and fan-out pressure.
- Start from a single-user editor and explain why it breaks under concurrency.
- Introduce the WebSocket Gateway as connection infrastructure, not as the source of document truth.
- Explain Document Server ownership and the Synchronization Engine clearly.
- Describe Operational Transform conceptually and mention CRDT as an alternative.
- Separate Presence Service from the authoritative edit path.
- Cover Version Store and Offline Queue as operational necessities, not just user features.
- Discuss graceful degradation: local queueing, reconnect resume, stale presence tolerance, and hotspot isolation.
- Draw a clear line between an edit being received and an edit being durably committed.
- Name fencing/epochs when discussing owner failover, unprompted.
Common mistakes
- Jumping straight to a giant final architecture.
- Giving a feature tour of comments, sharing, and formatting instead of explaining synchronization.
- Treating OT or CRDT as magic without showing where it sits in the system.
- Forgetting persistent connection scale and heartbeat load.
- Fusing presence into the same correctness-critical path as text edits.
- Ignoring reconnect storms, lost operations, or hot documents.
- Saying an edit is "saved" the moment the server receives it over the socket.
- Saying "one owner per document" without explaining how two owners are prevented during failover.
How to Handle Prompt Variants
These prompts are siblings. The collaboration architecture is similar, but each prompt changes what you emphasize. In every case, evolve the system live rather than jumping directly to the finished architecture.
Design Google Docs
Same core: Editor Client, WebSocket Gateway, Document Server, Synchronization Engine, Presence Service, Version Store, and Offline Queue. Different emphasis: a text-stream document model, high typing sensitivity, cursor and selection fidelity, and revision history that feels natural for long-form writing. Frame it as "a Google-Docs-style editor" and present the architecture as one reasonable design, not as a claim about Google's actual internals.
Design Figma Collaboration
Same core collaboration stack, but the data model is different: instead of a mostly linear text stream, Figma-style collaboration operates on canvas or vector-object state. That changes operation payloads and merge semantics, but the same architectural questions remain: persistent connections, authoritative ownership, synchronization, presence, and scale.
Design a Collaborative Editing Platform
This is the most general prompt, so emphasize the reusable platform concepts: routing documents to owners, reconciling concurrent operations, decoupling presence, supporting offline replay, and scaling fan-out. Then mention that text editors, whiteboards, and slide editors plug different document models into the same collaboration substrate.
Quick Reference Card
Everything you want in working memory before you walk into the room.
- 01A collaborative editor is fundamentally a convergence system under concurrency.
- 02The critical path is usually client → gateway → shard router → document owner → synchronization engine → broadcast → peers, protected by ownership fencing and an explicit durability boundary.
- 03Explain Operational Transform conceptually, and mention CRDT as an alternative rather than as required dogma — neither is universally superior.
- 04Separate durable document truth from ephemeral presence state.
- 05Always cover Version Store, Offline Queue, and Reconnection & Resync because real users disconnect.
- 06Call out hotspots, reconnect storms, split-brain ownership, and lost operations as first-class production risks.
- 07Tell the design as an evolution story: single editor → multi-user sync → conflict resolution → presence → history → offline → production scale.
- 08Never imply that receiving an operation over WebSocket means it is durably committed.
Interview Question Bank — Requirements and Scope
This category tests whether you scope the problem before designing, rather than assuming every collaboration feature is required.
What does "real-time" mean here, concretely?
Push for a concrete target instead of accepting the word at face value: local edits apply instantly (optimistic), remote propagation targets a low, illustrative latency budget, and durability follows its own separately-defined boundary. See Non-Functional Requirements.
- How many simultaneous editors per document should this handle? — Tests whether the candidate distinguishes typical collaboration size (a handful of editors) from viewer-heavy documents (thousands of passive viewers) — these stress different parts of the system.
- Is offline editing required, or just tolerated? — Changes whether Offline Queue and reconnect/resync are core requirements or a stretch goal.
- Do viewers need live updates, or just editors? — Affects whether presence and broadcast fan-out need to scale to a large passive audience.
- Are comments, suggestions, and version history in scope? — These have different data semantics than plain text edits — see Comments & Suggestion Mode.
- What are the durability expectations if a server crashes mid-edit? — Forces the candidate to state a durability policy early rather than discovering the gap later.
- Is this a plain text editor or a structured rich-text document? — Changes whether Structured Document Model needs to be part of the answer at all.
Interview Question Bank — WebSockets and Connections
Tests understanding of persistent connections as infrastructure, not just a transport detail.
Why WebSockets instead of polling?
Collaboration traffic is small, frequent, and bidirectional — polling adds latency and wastes work on that pattern, while a persistent socket keeps a cheap channel open for edits, acks, cursors, and heartbeats. See Polling vs WebSockets and WebSocket Session Lifecycle.
- What happens when a gateway dies? — Tests knowledge that gateways are stateless connection managers — clients reconnect to another gateway and resume from their last committed version, they don't lose document truth.
- Where does connection state actually live? — Probes whether the candidate keeps document truth out of the gateway entirely.
- How do you scale to millions of connections? — Tests horizontal gateway scaling and stateless design, not a single monolithic socket server.
- How do you handle a slow consumer? — See Slow Consumer in Failure & Scale Scenarios — bounded queues, coalesce presence first, never silently drop a committed edit.
- What happens during a reconnection storm? — Tests admission control, backoff/jitter, and prioritizing the edit path over presence during recovery.
Interview Question Bank — Ordering and Operation Protocol
Tests whether the candidate understands that transport is not exactly-once, and that the application layer has to compensate.
How do you prevent duplicate edits after a client retry?
Every operation carries a stable opId; the authoritative path deduplicates by opId before applying anything, so a retried submission is recognized and not reapplied. See Operation Ordering & Idempotency.
- Why do we need opId specifically, rather than relying on the transport? — Transport may redeliver or retry; opId-based dedupe is what makes at-least-once delivery safe to build on.
- Why do operations carry a baseVersion? — It tells the server what state the client believed was current, which is what the transform/merge step reconciles against.
- How do you detect reordered or missing client operations? — A per-client clientSeq complements opId — gaps or repeats in clientSeq reveal reordering or loss without implying a global clock.
- Do we need global ordering across all documents? — No — ordering only needs to be authoritative within one document; unrelated documents don't need coordinated ordering.
Interview Question Bank — OT and CRDT
Tests conceptual understanding of both synchronization strategies without requiring formal proofs.
Why does naive last-write-wins fail for collaborative editing?
Whole-document or blind-position writes let one user's edit silently overwrite another's, or apply against stale positions and corrupt text — the system needs a reconciliation step, not just a save. See Conflict Resolution.
- Explain Operational Transform without using mathematics. — Looking for: server finds what changed since the client's base version, transforms the incoming operation against that, assigns the next version, broadcasts the result. See Operational Transform Mechanics.
- What history does OT actually need to do this? — It needs the operations accepted since the client's base revision — if that's been compacted away, the server falls back to snapshot-based rebase. See OT History Retention.
- When might CRDT be preferable to OT? — Offline-heavy or more peer-to-peer-leaning designs, at the cost of different metadata and compaction trade-offs — not a strictly better choice. See OT vs CRDT.
- What complexity does CRDT introduce that OT avoids? — Accumulated identifiers, tombstones, and causal metadata that need careful, replica-safe garbage collection. See CRDT Metadata & Garbage Collection.
- Does CRDT eliminate the need for a backend? — No — durability, auth, presence, and networking are still needed regardless of which convergence strategy is chosen.
Interview Question Bank — Durability
This is one of the highest-signal categories — it separates candidates who have thought about failure from those who haven't.
When exactly do you acknowledge an edit to the client?
Only after the operation has been recorded per the configured durability policy — a lightweight transport ack may arrive earlier, but the "committed" status means durable, not just received. See Operation Durability & Acknowledgements.
- What if the owner crashes right after applying the edit in memory but before persisting it? — This is exactly the failure the durable-ack boundary prevents from being user-visible — see Lost Operations in Failure & Scale Scenarios.
- How do you guarantee an acknowledged edit is not lost? — By never sending the committed ack until the durability policy's boundary — durable log append or replicated write — is actually satisfied.
- What is the role of the operation log? — It's the durable, replayable record of accepted operations that recovery and materialization both depend on.
- Are the Document Store and the operation/version history updated as one atomic transaction? — Usually not — recovery instead relies on the operation log as source of truth, idempotent materialization, and version markers, not a distributed transaction. See Document Storage and the Durability Boundary.
Interview Question Bank — Ownership and Sharding
Tests whether the candidate can explain not just ownership, but how ownership is safely enforced during failure.
Why does each document need exactly one owner?
One owner per document gives the system a single place to assign authoritative versions and serialize accepted operations, which keeps convergence reasoning local instead of requiring cross-server coordination on every edit. See Document Owner Routing.
- How are documents assigned to servers? — A Shard Router maps a stable routing key to an owning server, maintaining an ownership directory gateways can resolve against.
- What happens when the owner dies? — See Document Owner Failover — a new owner is established with a higher epoch, recovers from snapshot plus log tail, and clients reroute.
- How do you move a hot document to different capacity? — A planned handoff drains in-flight operations and transfers the epoch cleanly, unlike an unplanned crash.
- How do you prevent two owners from both accepting writes during failover? — This is the core question — expects fencing/epochs: the durable write path rejects any write tagged with a stale epoch. See Document Owner Lease & Fencing and Split-Brain Document Ownership.
- Do unrelated documents need coordinated ordering with each other? — No — ordering is scoped per document; there is no need for a single global order across the whole platform.
Interview Question Bank — Presence
Tests whether the candidate keeps ephemeral collaboration signals from threatening document correctness.
Why is presence kept separate from the editing/document-consistency path?
Presence is ephemeral, best-effort, and non-authoritative — fusing it into the correctness-critical edit path would waste authoritative capacity on noisy signals and risk making document correctness depend on something that's allowed to be stale. See Presence & Cursor Fan-Out.
- What happens if the Presence Service fails? — Text editing continues correctly; presence degrades gracefully or hides rather than showing confidently stale state — see Presence Service Failure.
- How do cursors scale on a document with 10,000 viewers? — Not every viewer needs every cursor — sampling, coalescing, and capping rendered cursors keep this from scaling linearly.
- Do you persist cursor history? — No — presence is ephemeral by design; it is not treated like durable document history.
- How do you handle a user with multiple tabs open on the same document? — Presence keys on session/client identity, not just user ID, so multiple tabs don't collapse into one shared presence entry.
Interview Question Bank — Version History
Tests understanding of the snapshot/log relationship and how restore actually works.
Why store both snapshots and operations instead of just one or the other?
Snapshots make bootstrap and restore fast; the operation log preserves full detail and supports OT transform and audit needs. The hybrid bounds both storage cost and replay cost. See Snapshot & Operation Log.
- How often do you snapshot? — A cadence choice — by operation count, time, or semantic event — with no single universal number; trade speed of restore against storage cost.
- When can old operations be deleted? — Only once restore/history, OT transform-history, offline-retention, and audit needs no longer require them — see Snapshot Compaction & Retention.
- How does restore work while other users are actively connected? — Restore is a new mutation, not time travel — it verifies permission, creates a new authoritative version through the normal collaboration path, and rebases connected clients onto it.
- What if a snapshot is corrupted or inconsistent with the log? — See Operation Log / Snapshot Divergence — fall back to the last known-good snapshot and replay the verified log.
Interview Question Bank — Offline Editing
Tests whether the candidate treats reconnect as reconciliation rather than a simple retry.
What happens while the user is offline?
The client keeps applying edits locally and queues them with stable operation IDs and a known base version — typing never blocks on network availability. See Offline Reconnect Protocol.
- How does reconnect actually work? — Walk the handshake: authenticate, recheck permission, report last acked version and queued ops, receive missing operations or a snapshot, transform/merge queued edits, dedupe idempotently, resume live.
- What if the document changed significantly while offline? — A large gap triggers a snapshot-based rebase instead of incremental replay.
- What if the OT history needed to transform the client's queued edits was already compacted away? — See Offline Client Returns After History Compaction — snapshot rebase, not unbounded replay.
- What if the user's edit permission was revoked while they were offline? — The server rechecks current permission during reconnect and must not blindly replay queued writes if authorization no longer allows it.
Interview Question Bank — Security and Permissions
Tests whether authorization is treated as a one-time gate or a continuously enforced property.
Where is authorization actually enforced?
At the authoritative mutation path, on every write — not only when the socket first connects. See Authorization in Live Collaboration.
- Is checking access only at WebSocket connect time sufficient? — No — permission can change mid-session (revocation, workspace removal, link revoked); connect-time-only checks miss all of these.
- What happens after a live permission revocation? — See Permission Revoked During Active Editing — stop accepting writes, stop protected subscriptions, don't silently replay unauthorized offline edits.
- How do you prevent a malformed or malicious client from corrupting a document? — Validate every operation at the trust boundary — range, size, schema, base version — before it can influence authoritative state. See Bad Client Sends Malformed Operations.
Interview Question Bank — Hot Documents and Scale
Tests whether the candidate can distinguish different scaling bottlenecks instead of treating "hot" as one problem.
What actually becomes hot on a popular document: the write path or the fan-out path?
Could be either, and they need different fixes — many concurrent editors stress write serialization, while thousands of passive viewers stress broadcast fan-out even at low edit rates. See Hot-Document Fan-Out.
- How do you support thousands of simultaneous viewers on one document? — Hierarchical fan-out, gateway-local subscription groups, and coalesced presence, rather than a flat broadcast to every subscriber individually.
- Can you shard a single document across multiple owners? — Not casually — splitting the authoritative write path reintroduces the exact coordination problem fencing exists to prevent; see Whole-Document vs Block-Level Synchronization.
- What changes for a very large document? — Snapshot serialization cost, transform window size, client memory/rendering, and bootstrap size all grow — see Large-Document Partitioning.
- How do you move ownership of a hot document safely? — A planned handoff with a clean epoch transition, not an abrupt reassignment — see Document Owner Lease & Fencing.
Interview Question Bank — Multi-Region
Tests whether the candidate defaults to a sensible baseline instead of reaching for synchronous global consensus by instinct.
Where should the authoritative owner for a document live?
In a home/authoritative region for that document, with gateways distributed globally to terminate nearby client connections — keeping ordering and fencing localized rather than distributed across regions. See Multi-Region Collaboration.
- What if collaborators are on opposite continents from the home region? — They incur real network latency on their edit round trip — an accepted, explicit trade-off of this baseline, discussed in Single-Region Owner vs Multi-Region Writers.
- Would you ever allow active writers in several regions for the same document? — Possible, but substantially harder — requires cross-region coordination or consensus per operation unless the consistency model changes; treat it as an advanced alternative, not the default.
- What happens if the owner's home region fails entirely? — See Regional Failure — promote a fenced owner in a recovery region from replicated durable history, and be honest about the RPO/RTO trade-off.
Interview Question Bank — Failure Curveballs
These are rapid-fire "what would you do" prompts interviewers use to probe whether the architecture is real or just recited. Keep answers short and point to the owning failure scenario.
A client got a 'saved' acknowledgement, but the text disappeared after a server crash. What was wrong?
The ack was sent before the operation was actually durable — the ack boundary must mean durably committed, not just accepted in memory. See Lost Operations.
Two document servers both think they are the owner of the same document. What now?
Fencing epochs resolve it: the durable path rejects the stale owner's writes, the router refreshes ownership, and affected clients resync. See Split-Brain Document Ownership.
A client receives version 102 right after version 100. What should it do?
Detect the version gap and fetch the missing operation or a fresh snapshot rather than assuming pub/sub redelivery will fix it on its own. See Pub/Sub Broadcast Loss or Delay.
Pub/sub loses a message. Does the document diverge forever?
No, as long as version-gap detection and resync exist — pub/sub is a distribution mechanism, not the source of truth. See Pub/Sub Broadcast Loss or Delay.
The snapshot and the operation log disagree. How do you recover?
Fall back to the last verified snapshot, replay the verified log forward, and rebuild materialized state — never trust a snapshot that fails its own integrity check. See Operation Log / Snapshot Divergence.
A reconnecting client is months behind. What happens?
It almost certainly exceeds the retained operation history, so the server sends a current snapshot and the client rebases its queued edits against it rather than replaying an unbounded log. See Offline Client Returns After History Compaction.
A buggy client sends invalid edit ranges. What stops it from corrupting the document?
Validation at the trust boundary rejects the operation before it ever reaches the transform/merge step, and the client can be rate-limited or disconnected if it persists. See Bad Client Sends Malformed Operations.
The snapshot worker has been down for six hours. Is this an emergency?
Not for live editing, which continues normally — but snapshot age and log length should be alerting, because reconnect and restore cost keeps growing the longer it stays down. See Snapshot/Compaction Worker Failure.
One document suddenly has 100,000 viewers. What breaks first?
Almost certainly the fan-out/broadcast path, not the write path, since edit volume may stay low while distribution volume explodes — mitigate with hierarchical fan-out and coalesced presence rather than scaling the write path. See Document Hotspots and Hot-Document Fan-Out.