QA
Senior LevelSystem Design & Architecture

How do you design a Real-Time Collaborative Editor (like Figma or Google Docs)?

❓ Interview Prompt: Explain real-time collaborative editor architecture, Operational Transformation (OT) vs Conflict-Free Replicated Data Types (CRDTs), WebSockets, and document history.

Designing a Real-Time Collaborative Document/Canvas Editor (Figma/Google Docs):

Architecture:

1
Concurrency Control:
β€’
Operational Transformation (OT): Requires a central server to transform edit operations relative to concurrent user edits (used in Google Docs).
β€’
CRDTs (LWW-Element-Set / Yjs): Mathematically proven data structures where edits can be merged in any order on client devices deterministically without a central lock (used in Figma).
2
Communication: WebSockets for real-time operation streaming.

Code Implementation Example

markdown
Real-Time Collaborative Editor Architecture:

[Client A (Yjs CRDT)] ──(WebSocket Ops)──> [WS Gateway]
                                                β”‚
                                      (Broadcast CRDT Ops)
                                                β”‚
                                                β–Ό
[Client B (Yjs CRDT)] <──(WebSocket Ops)─── [WS Gateway]
                                                β”‚
                                        (Append to Event Log)
                                                β–Ό
                                        [Document Storage]
πŸ’‘Real-time collaborative editor architecture using CRDTs and WebSockets.
🎯 Interview Key Takeaway

Design real-time collaborative editors using CRDTs or OT over WebSockets to merge concurrent edits deterministically.

#System Design#Collaborative Editing#CRDT#WebSockets#Senior
Back to all System Design & Architecture Questions→

More System Design & Architecture Interview Questions

Beginner LevelSystem Design & Architecture

Explain the CAP Theorem and PACELC Theorem with real-world database examples.

Beginner LevelSystem Design & Architecture

What is Vertical Scaling (Scale Up) vs Horizontal Scaling (Scale Out)?

Beginner LevelSystem Design & Architecture

How do Load Balancers distribute traffic (Round Robin, Least Connections, IP Hash)?