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 →
- Should you add read replicas or shard when the database is slow?
Add read replicas when reads dominate, since they scale reads cheaply. Shard when writes or data size exceed one machine. Check indexes, queries and caching before either.
BeginnerQuick answer1 min read - What is the difference between sharding and partitioning?
Partitioning splits a big table into smaller parts, often inside one database. Sharding is partitioning where the parts live on different servers, so both data and load are spread across machines.
BeginnerQuick answer1 min read - How do you choose a good shard key?
A good shard key has high cardinality, spreads data and traffic evenly, and matches the most common query so requests hit one shard. Avoid keys that grow monotonically or are skewed, like timestamps or country.
IntermediateQuick answer1 min read - What is a hot partition and how do you fix it?
A hot partition is a shard or partition that receives far more traffic than the rest, so it becomes the bottleneck. Fix it with better keys, key salting, splitting the hot shard, or caching hot items.
IntermediateQuick 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