Design real-time collaboration like Google Docs or Figma: syncing concurrent edits with OT or CRDTs, presence and cursors, offline editing, the transport layer, and undo in a multi-user world.
Functional
Non-functional
The core problem: two users edit concurrently from the same starting state. Alice inserts "X" at position 0. Bob deletes the character at position 3. If each client simply applies the other's operation as is, Bob's delete hits the wrong character on Alice's screen, because her insert shifted everything by one. The documents diverge.
Two families of algorithms solve this: Operational Transformation (OT) and CRDTs (Conflict-free Replicated Data Types).