Design Real-Time Collaborative Contract Drafting With AI Suggestions
Last updated: November 29, 2026
Quick Overview
Design a collaborative editor where several lawyers edit the same agreement at once and an AI assistant proposes tracked changes that anyone can accept or reject, with full version history.
Harvey
November 29, 20260
0
0 solved
Design a collaborative editor where several lawyers edit the same agreement at once and an AI assistant proposes tracked changes that anyone can accept or reject, with full version history.
Drafting and negotiating agreements is core legal work, and Harvey brings AI suggestions into that loop. The interviewer probes conflict resolution (OT or CRDT), how AI edits anchor to text that keeps moving, presence, and auditability of who or what changed each word.
What the Interviewer Expects
- Choose and justify OT or CRDT for concurrent edits
- Model AI suggestions as anchored tracked changes, not direct edits
- Handle suggestions whose anchor text was edited before acceptance
- Provide presence, cursors, and comments
- Keep an auditable version history with author attribution, including AI
- Address document size and offline or reconnect behavior
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you anchor a suggestion so it survives edits elsewhere in the document?
- How would you import and export Word tracked changes faithfully?
- What happens when two people accept conflicting suggestions at once?
- How do you scale a single hot document with 50 editors?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: concurrent editing with sub-second convergence, cursors and presence, comments, AI suggestions as tracked changes with accept and reject, history with restore and a redline between any two...
High-Level Design
Clients hold a CRDT replica (a sequence CRDT such as Yjs or a similar library) and connect over WebSockets to a document session server; all sessions for one document route to the same server by c...