- Multiple users can edit simultaneously
- Changes appear in real time
- Maintain document consistency
- Show cursor positions of other users
- Support basic formatting
- How do you handle concurrent edits?
- How do you resolve conflicts?
- How do you sync changes efficiently?
- What happens when user goes offline?
- How do you handle large documents?
- UI Layer
- Data Model
- Communication Layer
- Sync Strategy
- Conflict Resolution
- State Management
- Performance
- Edge Cases
- Editable document area (contenteditable or editor framework)
- Cursor indicators for users
- Toolbar (formatting)
- Real-time text updates
- Cursor tracking
- Highlight remote edits

- Entire document as text or structured nodes
- Operations instead of full document updates
- Insert "A" at position 10
- Delete from position 5–8
- Persistent connection
- Low latency updates
- User makes change
- Send operation to server
- Server broadcasts to other clients

- Transform operations based on concurrent edits
- Each client maintains independent state
- Merge changes without conflicts
- Mention OT (Google Docs style)
- Mention CRDT as advanced alternative
- Two users editing same position
- Transform operations before applying
- Maintain consistent order

- documentContent
- operationsQueue
- remoteUsers (cursor positions)
- connectionStatus
- Separate local edits vs remote updates
- Apply changes immediately in UI
- Sync with server later
- Adjust via transformation
- Track user cursor position
- Broadcast to others
- Render colored cursors

- Save document locally (debounced)
- Sync periodically
- Offline editing
- Replay operations
- Chunk Updates: Send small operations, not full document
- Virtualization: For large documents
- Batching: Group multiple operations
- Debouncing: Reduce network calls
- Simultaneous edits
- Network delays
- Offline users
- Large documents
- Undo/Redo
- Cursor jumps
- Understanding of real-time sync
- Knowledge of OT/CRDT
- Handling conflicts
- UI + data consistency
- Performance thinking














