System Design

Sharding & Replication

6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.

  • Our single database can no longer hold the write volume, so we're going to shard it. How do you pick a shard key, and what goes wrong if you pick a bad one? Mid level
  • Your primary database is read-replicated, but users keep reporting that a setting they just saved doesn't show up when the page reloads. Walk me through what's happening and how you'd give them read-your-writes consistency without forcing every read onto the primary.Go Pro Staff-principal level
  • Walk me through how you'd set up replication for a primary database — what topology, how do you handle replication lag, and what happens when the primary fails?Go Pro Mid level
  • Your single database has hit its write ceiling and you need to shard it. How do you choose a shard key, and how do you reshard later without downtime when one shard gets hot?Go Pro Senior level
  • You're choosing the replication topology for a service's datastore where a primary failure must not lose committed data but write latency still has to stay tight. Walk me through synchronous, asynchronous, and quorum replication and how you'd land the trade-off.Go Pro Staff-principal level
  • Walk me through how you'd set up database replication for a read-heavy service, and how you handle the case where a user writes data and then immediately reads it back from a replica that hasn't caught up.Go Pro Senior level
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.