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 →
- How does leader-follower database replication work?
All writes go to one leader, which streams its changes to follower replicas. Followers serve reads, which spreads read load and gives a standby copy if the leader fails, but they may lag behind.
BeginnerQuick answer1 min read - 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 synchronous and asynchronous replication?
Synchronous replication makes the leader wait for replicas to confirm before acknowledging a write, so no acknowledged write is lost but writes are slower. Asynchronous replies immediately and replicates later, which is faster but can lose recent writes.
IntermediateQuick answer1 min read