Design Scale-to-Zero Hosting for User Web App Deployments
Last updated: November 29, 2026
Quick Overview
Design the serving layer behind an Autoscale style deployment product: user apps run as containers that scale up with traffic, scale down to zero when idle, and wake on the next request, billed by compute actually used.
Replit
November 29, 20260
0
0 solved
Design the serving layer behind an Autoscale style deployment product: user apps run as containers that scale up with traffic, scale down to zero when idle, and wake on the next request, billed by compute actually used.
Replit Deployments let anyone publish an app, and most of those apps get little traffic, so scaling idle apps to zero is what makes hosting affordable. The interviewer checks routing, cold start mitigation, the autoscaling signal, and how billing and isolation fit in.
What the Interviewer Expects
- Separates the routing tier, the activator for cold starts, and the container fleet
- Picks concurrency or in-flight requests as the scaling signal, not only CPU
- Holds requests during cold start with a timeout instead of failing them
- Reduces cold start with pre-pulled images and snapshot restore
- Meters usage per instance second for billing
- Discusses noisy neighbors and abuse
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 support WebSockets on a scale-to-zero app?
- A user's app goes viral on Hacker News. Walk through the first 60 seconds.
- How do you keep cold starts under one second for a 2 GB image?
- How do scheduled jobs fit into the same fleet?
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
Functional: custom domains and a default subdomain, HTTPS, deploy a built image, scale from 0 to N, wake on request, logs and metrics. Non-functional: warm request overhead under 10 ms, cold start ide...
High-Level Design
Edge load balancers terminate TLS and look up host -> app_id in a cached routing table. Routers forward to a healthy instance if one exists. If the app has zero instances, the request goes to an **a...