KatInterview

Design a Remote Cloud Development Environment Service

System DesignModel answer
HardModel answerSystem Designdistributed-systemsorchestrationmulti-tenancy

Last updated

Design a scalable platform that provisions on-demand remote dev machines accessible via browser, SSH, or IDE tunnel, covering lifecycle, isolation, storage, multi-tenancy, and observability.

Remote Cloud Development Environment Service

Your team is building a hosted platform that gives engineers instant access to remote development machines — think full Linux boxes in the cloud, reachable from a browser tab, an SSH client, or a VS Code / JetBrains remote tunnel. These are not lightweight sandboxes: each machine carries a real OS image, a configured toolchain, a checked-out repository, a persistent home directory, injected credentials, and a chosen allocation of CPU, memory, disk, and optionally GPU.

What the platform must support

Machine lifecycle: users create, start, stop, pause, resume, and delete machines. Machines are stamped from versioned templates. Pause must snapshot RAM so a resume feels nearly instant — it is not the same as stop/start.

Machine contents: each machine bundles an OS base image, language runtimes and toolchain packages, a repository clone, a user home directory that survives reboots, injected secrets (tokens, SSH keys), and a resource profile.

Organizational features: organizations contain teams; each team has members with roles. The platform enforces per-org and per-team quotas (machine count, vCPU-hours, spend). All actions are recorded in an immutable audit log. A cost-control mechanism can suspend over-budget orgs and auto-pause idle machines.

Quality targets:

  • Warm resume (from RAM snapshot): single-digit seconds
  • Cold create from a common template: tens of seconds, not minutes
  • A control-plane outage must not terminate running machines or drop live sessions
  • The system must tolerate node loss without data loss on persistent machines

Scale and constraints to state explicitly

  • ~200,000 total registered machines; ~10–20% running concurrently at peak
  • Thousands of organizations
  • Multi-region deployment (latency and resilience)
  • Workloads are untrusted: users run arbitrary code, so isolation must be a real kernel or hardware boundary — not just Linux namespaces
  • Identity comes from an existing OIDC/SSO provider (not your responsibility to build)
  • Billing invoicing is out of scope; you emit metering events consumed by a separate billing service
  • Building the in-box IDE itself is out of scope

What to walk through

Cover each of the following areas, call out the major trade-offs in each, and identify where the system is genuinely bottlenecked:

  1. Requirements and clarifying questions — state your assumptions, size the design
  2. High-level architecture — major components and how they relate
  3. Lifecycle and state model — the full state machine including transient and failure states
  4. Scheduling and provisioning — how machines get placed and started fast
  5. Isolation — what mechanism, why, and what it buys you
  6. Storage and persistence — what data lives where, what survives a node crash
  7. Multi-tenancy — RBAC, quotas, audit, async APIs
  8. Failure handling — node loss, provisioning failures, gateway crashes, duplicate events
  9. Observability and cost control — metrics, tracing, idle management, budget enforcement

Strong answers are concrete: name the components, justify the choices, and honestly identify the bottlenecks rather than describing a system where everything scales trivially.

Hints

Hint 1

Start by distinguishing the control plane from the data plane, then ask what must remain available when the control plane is down — that single question shapes most of the architecture.

Hint 2

Pause/resume is not the same as stop/start. RAM snapshots introduce a separate storage path and latency budget; make sure your state machine has distinct states and your storage design accounts for snapshot size and attach speed.

Hint 3

The provisioning latency SLO (cold create in tens of seconds) is only achievable with a warm pool, copy-on-write base images cached on host, and prebaked snapshots — explain each layer and why it is needed before talking about the scheduler.