Design a Collaborative Document Editor

Read the full interview experience this question came from →

Quick Overview

Design collaborative editing with an explicit operation model, OT or CRDT convergence, durable history, reconnect recovery, access control, and separate presence state.

Design a Collaborative Document Editor

Company: xAI

Role: Frontend Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

Design a collaborative document editor where several users can edit the same document and see each other's changes. ### Constraints & Assumptions The source names collaborative-document design without specifying an algorithm or scale. Define a concrete initial document model, such as plain text, and discuss rich text or offline editing as explicit extensions. Separate durable edits from ephemeral cursor presence. ### Clarifying Questions Must offline edits merge? What ordering and conflict behavior should users see? Are documents plain text or structured rich text? Who can edit, view, or share? What history and recovery guarantees are required? ### What a Strong Answer Covers A document/operation model, convergence strategy, synchronization and reconnection, snapshots/history, access control, presence, and operational failure handling. ### Follow-up Questions Why is last-write-wins replacement of the whole document inadequate? How do concurrent insertions at the same position converge? What changes when a client reconnects with old edits or loses permission?

Overview: Design collaborative editing with an explicit operation model, OT or CRDT convergence, durable history, reconnect recovery, access control, and separate presence state.

Read the full xAI Frontend Engineer interview experience this question came from

|Home/System Design/xAI
xAI logo
xAI
Sep 15, 2026
mediumFrontend EngineerOnsiteSystem Design
0
0

Design a collaborative document editor where several users can edit the same document and see each other's changes.

Constraints & Assumptions

The source names collaborative-document design without specifying an algorithm or scale. Define a concrete initial document model, such as plain text, and discuss rich text or offline editing as explicit extensions. Separate durable edits from ephemeral cursor presence.

Clarifying Questions Guidance

Must offline edits merge? What ordering and conflict behavior should users see? Are documents plain text or structured rich text? Who can edit, view, or share? What history and recovery guarantees are required?

What a Strong Answer Covers Guidance

A document/operation model, convergence strategy, synchronization and reconnection, snapshots/history, access control, presence, and operational failure handling.

Follow-up Questions Guidance

Why is last-write-wins replacement of the whole document inadequate? How do concurrent insertions at the same position converge? What changes when a client reconnects with old edits or loses permission?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...