Design Isolated Container Orchestration for Millions of Workspaces
Last updated: November 29, 2026
Quick Overview
Design the backend that gives every user project its own Linux container with a persistent filesystem, starting it within seconds when the user opens the workspace and reclaiming it when they leave, at a scale of millions of projects and hundreds of thousands concurrently running.
Replit
November 29, 20260
0
0 solved
Design the backend that gives every user project its own Linux container with a persistent filesystem, starting it within seconds when the user opens the workspace and reclaiming it when they leave, at a scale of millions of projects and hundreds of thousands concurrently running.
This is the core of the Replit platform: each Repl is a real Linux environment running untrusted code, opened from a browser in seconds. Infrastructure interviewers use it to check isolation choices, storage design for project filesystems, placement, and session routing.
What the Interviewer Expects
- Chooses an isolation boundary (gVisor, microVMs, or hardened containers) and defends it
- Separates durable project storage from ephemeral compute
- Designs fast start via cached base images, lazy loading, and copy-on-write layers
- Routes a browser session to the right host and handles reconnects
- Plans eviction of idle containers and resource limits per plan
- Covers abuse, egress control, and host failure
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you let two collaborators share one running container?
- How do you snapshot a running container so a reopened project resumes where it left off?
- How would you migrate a running workspace off a host being drained?
- What changes for GPU workspaces?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Open a project and get a shell within about 2 seconds at p50. Files persist across sessions and survive host loss. Untrusted code must not reach other tenants or the control plane. Limits on CPU, memo...
High-Level Design
A session gateway accepts the browser websocket, authenticates, and asks the control plane for the project's container. The control plane checks a lease table (`project_id -> host, container_i...