[ INFO ]category: System Design difficulty: hard freq: medium first seen: 2026-01-12
[HARD][SYSTEM DESIGN][MEDIUM]data_engineeringmobilewebCollaborationbackendSystem DesignReal-time Systems
$catproblem.md
LinkedIn's "Design Collaborative Code Editor" is a system design interview question focusing on real-time collaboration, often compared to tools like CoderPad or Google Docs for code. It emphasizes backend scalability, real-time syncing across web/mobile clients, and safe code execution.[4][6]
Problem Statement
Design a collaborative code editor that enables multiple users (e.g., 2-3 in interviews) to edit code simultaneously in real-time. Key goals include syncing text changes instantly, executing code securely in isolated environments, retaining session content long-term (e.g., 10 years), and supporting web/mobile access with low latency.[2][6][4]
Functional Requirements
Real-time text editing with multi-user cursors and conflict resolution (e.g., Operational Transformation or CRDTs).
Code execution in sandboxed environments supporting multiple languages.
Session sharing/joining, authentication, and persistence.
Features like syntax highlighting, autocompletion, and version history.[5][2][4]
Non-Functional Requirements
Scale to thousands of concurrent sessions with <100ms latency for edits.
High availability (99.9%+ uptime), secure execution to prevent sandbox escapes.
Data retention for 10+ years; handle mobile/web clients with offline support.[6][2][4]
Constraints and Examples
No formal input/output examples exist as this is open-ended, but typical scenarios include:
Example 1: Users A and B join session ID "123"; A types "print('Hello')", B sees it instantly and adds a cursor at line 2.
Example 2: Execute Python code; output streams to all clients without affecting others.
Constraints: Max 10 users/session, 1MB code limit, 1000s daily active sessions, bursty interview traffic.[2][4][6]