KatInterview

Design a Cloud IDE System for Browser-Based Code Execution

System DesignModel answer
HardModel answerSystem Designsystem-designcloud-idesandboxing

Last updated

Architect a cloud-based development environment enabling real-time browser code editing, interactive terminal streaming, sandboxed execution, and workspace state persistence at scale.

Design a cloud-based Integrated Development Environment (IDE) platform. The system allows software developers to create project workspaces via a web browser, edit source code, run scripts, execute interactive terminal sessions, and preview web application outputs.

All computation and file storage occur on cloud backend infrastructure rather than on the user's local hardware.

Scope & Core Aspects to Address

  1. Workspace Lifecycle & Scheduling: How are development environments created, hibernated during idle periods, and restored efficiently with low cold-start latency?
  2. Untrusted Code Sandboxing & Multi-Tenancy: How is the backend isolated to safely execute arbitrary code, enforce resource quotas, and prevent unauthorized network access or host breakouts?
  3. Storage & State Persistence: How are workspace file systems structured, updated in real time, and persisted across session hibernations?
  4. Real-time Client Communication: How do editor events, terminal input/output, Language Server Protocol (LSP) diagnostics, and application previews flow between the browser and backend nodes?
  5. System Resiliency & Scale: How does the architecture scale to support tens of thousands of concurrent active environments and handle node failures gracefully?

Provide a detailed system design covering architectural components, data flows, sandboxing trade-offs, and state management techniques.

Hints

Hint 1

Differentiate clearly between the Control Plane (scheduling, routing, user metadata) and the Data Plane (execution hosts, microVM sandboxes).

Hint 2

Compare hypervisor-based virtualization (e.g., Firecracker microVMs) against standard container runtimes (e.g., Docker, gVisor) for running untrusted tenant code.

Hint 3

Consider how network volume attachment versus asynchronous object storage snapshotting affects hibernation startup latency and data consistency.