InterviewStack.io LogoInterviewStack.io

Replication, Partitioning, and Sharding Questions

Scaling and distributing data across nodes: primary-replica and multi-primary replication, read-replica scaling, horizontal partitioning, and sharding strategies with their key-selection and rebalancing challenges. Covers replication lag, routing, and the operational cost of a partitioned topology. Key to designing databases that scale horizontally.

HardTechnical
146 practiced

Propose an algorithm to split a hot partition's integer keyspace into multiple shards while minimizing total key movement across the cluster. Assume keys map to integer ranges and you can move contiguous ranges. Describe computational approach (greedy, dynamic programming, or clustering), complexity, and operational steps to execute such split online.

MediumTechnical
101 practiced

Design partitioning strategies for a multi-tenant time-series database ingesting sensor data: weigh per-tenant partitions, time-range partitions, and hybrid approaches. Discuss retention and compaction strategies, queries for recent vs historical data, and SRE operational considerations for compaction and storage reclaim.

MediumTechnical
82 practiced

Your service must perform joins across user records and orders that live on different shards when producing a small cross-tenant report. Outline application-level, middleware, and database-layer strategies to implement cross-shard joins. Discuss performance, correctness, and caching trade-offs.

MediumTechnical
93 practiced

Explain how caching layers (application cache, Redis, CDN) and data locality strategies interact with sharded databases. As SRE, propose cache placement and invalidation strategies to reduce cross-shard traffic and prevent cache-driven hotspots during resharding or failover.

HardSystem Design
90 practiced

Design a globally-distributed, sharded database for a social network with 200M users across 5 regions. Requirements: 99.99% read availability, 99.9% write availability, <100ms regional read latency for 95% of reads, support friend-graph queries, and obey regional data residency. Provide architecture, replica topology, sharding strategy, cross-shard query approach, and how SREs will monitor and enforce SLOs and error budgets.

Unlock Full Question Bank

Get access to all Replication, Partitioning, and Sharding interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.