A team proposes CRDTs for a collaborative document editor. What do you check before agreeing?
Show the full answer Hide the answer
What the interviewer is testing
Whether you know what CRDTs guarantee and what they cost, rather than treating them as the obvious answer for collaboration.
What to check
Are there global invariants? CRDTs guarantee convergence, not correctness — everyone reaches the same state, which may not be the state anyone intended, and no invariant can be enforced. For free text this is fine. For a document with structural rules — a form that must validate, a spreadsheet with constraints, an approval state machine — it is not.
Metadata growth. Text CRDTs must retain tombstones for deleted characters, so a heavily edited document's metadata can substantially exceed its content. Ask what the size is after a year of editing, and whether garbage collection across replicas that may be offline for months has been designed.
Whether a central server exists anyway. If documents are stored and synchronised through a server, operational transformation is a legitimate alternative: more compact, well proven in production editors, and it requires the central ordering that you already have. CRDTs earn their advantage in genuinely peer-to-peer or long-offline scenarios.
Intention preservation. Convergence does not mean the merged result reads sensibly. Two people editing the same sentence converge to something neither wrote, and the user experience of that needs designing — presence indicators, cursors and selection sharing do more for perceived quality than the merge algorithm.
Undo semantics, which are genuinely difficult in a collaborative context and are frequently discovered late.
The recommendation
Agree if the offline requirement is real and the content is genuinely free-form. Push back if there is a central server, the offline window is short, and the document has structure — where the simpler alternative carries less metadata and less complexity.
What a strong answer adds
Recommending a mature library rather than an implementation. CRDT correctness is subtle, the published algorithms have known edge cases, and the performance characteristics under real editing patterns are hard-won. This is not a build decision.
Common weak answers
Approving because CRDTs are the modern answer for collaboration. Rejecting them without naming operational transformation as the alternative.