← All interview questions

Skill Zuno · skillzunos.com · System Design

Replication and Sharding interview questions

Prepare for Replication and Sharding interviews on Skill Zuno. This practice book covers Replication and Sharding interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.

Open Replication and Sharding on Skill Zuno

Also see the Replication and Sharding tutorial.

Replication keeps copies of the same data on several machines for availability and read scaling, while sharding splits data across machines so each holds only part of it. Most large databases combine both. Interviews cover leader-follower and multi-leader replication, synchronous versus asynchronous replication, shard keys, hot spots and resharding.

Sample Replication and Sharding interview questions

What is the difference between replication and sharding?

Replication copies all the data to several nodes for availability and read throughput. Sharding splits the data so each node holds a subset, which increases write throughput and total capacity.

What is replication lag and how does it affect users?

Asynchronous followers apply changes a little after the leader. A user can write and then read stale data from a follower; reading your own recent writes from the leader avoids this.

What makes a good shard key?

High cardinality, an even spread of reads and writes, and alignment with the most common queries so they hit one shard. User ID often works; a timestamp sends all new writes to one shard.

What is the problem with range-based sharding?

Sequential keys such as dates or auto-increment IDs put all new writes on the last shard, creating a hot spot. Hash sharding spreads them but loses efficient range scans.

Why are cross-shard transactions hard?

They need a distributed protocol such as two-phase commit, which adds latency and blocks if the coordinator fails. Designs try to keep each transaction inside one shard.

What you can practice

  • Replication and Sharding interview questions for beginners and experienced developers
  • Level-based practice: New, Easy, Medium, Hard, and Diff
  • System Design topics alongside Replication and Sharding on skillzunos.com

More System Design interview questions

All interview questions