Sign in to keep reading
“Remote Devbox” is free with an account. Your progress and bookmarks follow you across devices.
Sign in to continueDesign a browser-based cloud IDE - This system design covers devbox provisioning, lifecycle management, secure connectivity, and real-time streaming at scale.
Written by a Staff+ Engineer and an Engineering Manager
10+ years of experience in cloud infrastructure and developer tools. Tech lead for browser-based development environments and VM orchestration at scale. Over 12 years of industry experience with 6 years in engineering leadership, building and scaling tech infrastructure teams that deliver end-to-end large-scale distributed systems.
“Remote Devbox” is free with an account. Your progress and bookmarks follow you across devices.
Sign in to continueThink Beyond the Happy Path
Could you answer these today? Tick what you already know.
Design a browser-based, cloud IDE (similar to Google Colab) where users can write code, run it on remote devbox, and view results in real time—without installing anything locally.
This question evaluates how you handle high scalability, resource scheduling and lifecycle management and low-latency streaming of logs/output at scale. The hardest parts are safely provisioning/tearing down execution environments and delivering interactive output efficiently and reliably.
For scope alignment, we assume the system's responsibility ends at the control plane + transport layer:
To keep the interview scope bounded and the design concrete, we'll make 4 product-level assumptions:
Devbox is VM-based (by default).
We optimize for strong isolation and predictable resource accounting. Containers can be an implementation variant later, but the control-plane shape stays similar.
User ↔ workspace ↔ devbox is 1:1:1. A user has at most one active workspace in this system, and each workspace has at most one active devbox. This makes lifecycle, placement, and routing fully deterministic: user → workspace → devbox always resolves to a single target (no ambiguity, no multi-attach).
No devbox sharing.
The devbox is single-attached. We avoid multi-writer compute complexity (concurrent terminals/kernels, conflicting processes, shared state coordination). If we later support collaboration, it applies to WorkspaceFiles, not the live devbox.
Devbox disk persists via volume/snapshot.
Compute is replaceable, but disk is . If a VM restarts or is replaced, we reattach the same persistent volume (or restore from snapshot), so users don't lose their working directory or re-download dependencies.
FR1 — Workspace files (edit + persist)
FR2 — Devbox provisioning & lifecycle (attach)
FR3 — Execute commands (interactive)
FR4 — Real-time streaming (stdout/stderr/events)
NFR1 — Cluster Scalability & Fair Scheduling
Metric: peak devbox lifecycle requests (start/resume) 10K req/s
At peak hours, many users can open the IDE at the same time. The hardest scaling pressure is devbox start/resume (VM + disk attach), not the command execution inside the devbox. This NFR requires the system to handle large bursts of start/resume requests reliably and degrade predictably when capacity is tight.
Common deep dive interview question (team-scale runtimes)
NFR2 — Secure Connectivity (Browser ↔ Remote Dev Env)
Metric: interactive connection setup p95 ≤ 1s (and stays encrypted end-to-end)
Users are coding in a browser, but the real execution happens in a powerful remote devbox. The key requirement is to provide a safe, reliable, encrypted channel from the browser to that devbox for terminal/execute/output streaming—without exposing the devbox directly to the public internet. This NFR forces the design to treat connectivity as a first-class problem: how sessions are established, how traffic is routed, and how we keep the devbox reachable only through controlled paths.
Common deep dive interview question (connectivity path)
NFR3 — Real-time Output/Log Streaming at Scale
Metric: stream latency (devbox → browser) p95 ≤ 250ms
The IDE feels "local" when output shows up immediately: prints, errors, progress, terminal echo. The hard part isn't sending a few lines — it's staying smooth at high concurrency with real-world networks: tabs refresh, connections drop, and some sessions produce very noisy logs. This NFR pushes the design to handle reconnect, backfill (so users don't miss output), and flow control so streaming stays fast and stable under load.
Common deep dive interview question (reconnectivity)
Requirement Summary
| Functional Requirements (FRs) | |
|---|---|
| Name | Description |
| 1. Workspace files | User can create/open a workspace and edit WorkspaceFiles in-browser with autosave. |
| 2. Devbox provisioning & lifecycle | Start/resume/suspend/stop a managed, time-bounded devbox (VM) for a workspace. |
| 3. Execute commands | User can execute code/commands on the attached devbox and cancel/interrupt. |
| 4. Real-time streaming | Stream stdout/stderr and execution events to the browser in real time. |
| Non-Functional Requirements (NFRs) | |
|---|---|
| Name | Description |
| 1. Cluster Scalability | Peak devbox lifecycle requests (start/resume) 10K req/s. |
| 2. Secure Connectivity | Interactive connection setup p95 ≤ 1s, encrypted end-to-end. |
| 3. Real-time Streaming | Stream latency (devbox → browser) p95 ≤ 250ms. |
A user works inside a Workspace (workspace_id, user_id, updated_at), which is the top-level container for files and settings. The editable content lives as WorkspaceFile (workspace_id, path, content_ref, version, updated_at) to support autosave and versioning.
When the user clicks "Connect," the system provisions a Devbox (devbox_id, workspace_id, state, vm_ref, , ) and attaches a durable (, , , , ) so compute can be replaced without losing the working directory. Finally, to support real-time output plus refresh/reconnect, the client maintains a (, , , , ) so the streaming channel can resume from the last-seen offset and backfill gaps.
To keep things lightweight, we'll stick to the core entities implied by the journey (workspace → devbox → stream):
Workspace
Top-level container the user works in (and the anchor for 1:1:1 mapping).
Example columns: workspace_id, user_id, status, created_at, updated_at
WorkspaceFile (aka "File")
The editable content inside a workspace, with autosave + versioning.
Example columns: file_id, workspace_id, path, latest_version, updated_at, content_ref
Devbox (VM compute)
The actual remote environment attached to the workspace.
, , (STARTING/RUNNING/SUSPENDED/STOPPED), , ,
We can map the functional requirements back to a small, generic API surface, along with the entities. For brevity, we use one representative API per area and leave the obvious read/list variants for the audience to expand.
POST /workspaces/{workspace_id}/files:writePOST /workspaces/{workspace_id}/devbox:transition (body has desired_state: START/RESUME/SUSPEND/STOP)POST /workspaces/{workspace_id}/exec
202 Accepted (or 200) and streams output over the active stream connectionWS /streamsTo keep the High-Level Design easy to follow, we'll stay intentionally lightweight: for each functional requirement, we'll show (1) a step-by-step workflow, and (2) a diagram where one arrow maps to one step. This level of detail is usually enough to prove the system works end-to-end.
That said, we know the real interview signals often come from follow-up questions. So after HLD, we'll go deeper using the challenge-driven deep dives already implied by our NFRs (notebook collaboration consistency, runtime scaling and scheduling for large teams, environment lifecycle efficiency, secure client-to-runtime connectivity, and reliable log streaming with reconnect/backfill).
last_active_atexpires_atvolume_idworkspace_idsnapshot_refattached_devbox_idstateworkspace_iddevbox_idstream_typecursorupdated_atdevbox_idworkspace_idstatevm_reflast_active_atexpires_atDevboxDisk (Volume/Snapshot)
The durable disk for the devbox (compute replaceable, disk durable).
Example columns: volume_id, workspace_id, attached_devbox_id, size_gb, snapshot_ref, state
StreamCursor
Client's last-seen offset for stdout/stderr/events so reconnect can backfill.
Example columns: workspace_id, devbox_id, stream_type (STDOUT/STDERR/EVENT), cursor, updated_at