Design Real-Time Co-Editing Between Users and the Model in Canvas
Last updated: November 29, 2026
Quick Overview
Design collaborative editing for a ChatGPT Canvas-style document or code editor where the user types, the model streams edits into specific regions at the same time, and later several people may edit together.
OpenAI
November 29, 20260
0
0 solved
Design collaborative editing for a ChatGPT Canvas-style document or code editor where the user types, the model streams edits into specific regions at the same time, and later several people may edit together.
Canvas turns ChatGPT into a shared editor where the model is a collaborator that rewrites selections and inserts code while the user keeps typing. The interviewer wants to see a real concurrency model (OT or CRDT), how model edits are expressed as operations, and how conflicts with human typing are handled.
What the Interviewer Expects
- Choose OT or CRDT and explain the convergence guarantee
- Represent model edits as targeted operations, not whole-document replacement
- Anchor model edits to stable positions so concurrent typing does not misplace them
- Stream model edits incrementally with undo as a single unit
- Persist versions and support restore
- Handle offline and reconnect
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
- What happens if the user deletes the paragraph the model is currently rewriting?
- How do you let the user accept or reject a model edit as a suggestion?
- How does the server scale if documents get 20 human collaborators?
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
- A document (text or code) shared between the user and the model; later multiple users.
- Model edits target ranges (rewrite selection, insert function), streamed token by token.
- User can keep typi...
High-Level Design
- Client editor with a CRDT document (for example a sequence CRDT like Yjs or a Fugue-style list).
- Document server per doc (sharded by
doc_id) relays updates over WebSocket and persists th...