Interview Q&A / System Design
System Design interview questions
Caching, scaling, databases and classic design problems for beginners.
Prefer rapid revision? Practise System Design short interview answers →
- What is the difference between horizontal and vertical scaling?
Vertical scaling (scaling up) makes one machine bigger with more CPU, RAM or faster disks. Horizontal scaling (scaling out) adds more machines and spreads the load across them. Vertical is simpler but has a hard ceiling and a single point of failure; horizontal scales further and survives failures but needs stateless services and a load balancer.
BeginnerIn-depth4 min read - When would you choose vertical scaling over horizontal scaling?
Choose vertical scaling when the system is small, stateful, or hard to split, such as a single relational database. It is simple and fast to do, but it has a hardware ceiling and leaves one machine as a single point of failure.
BeginnerQuick answer1 min read - Why are stateless services easier to scale horizontally?
A stateless server keeps no per-user data in its own memory, so any server can handle any request. You can add, remove or replace servers freely behind a load balancer, with no sticky routing.
BeginnerQuick answer1 min read - How do you add more shards to a running system without a long outage?
Avoid plain modulo hashing, which moves most keys when the shard count changes. Use consistent hashing or many small virtual shards mapped to servers, then move a few of them in the background while dual-checking routing.
AdvancedQuick answer1 min read