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, failover and split-brain handling, cross-shard operations such as joins, distributed transactions, and global secondary indexes, and the operational cost of a partitioned topology. Key to designing databases that scale horizontally.

HardTechnical
91 practiced

Cross-shard joins are expensive. Describe three practical strategies to handle queries that join data across shards (e.g., join users to transactions where users are sharded by user_id and transactions by account_id). For each strategy discuss latency, complexity, and when you'd pick it.

EasyTechnical
136 practiced

List and explain four properties that make a good shard key. For each property, give a brief example (user_id, timestamp, region, email hash, etc.) and explain why it helps avoid hotspots or cross-shard queries.

MediumTechnical
72 practiced

List the key metrics and signals you would monitor to detect shard hotspots and imbalance in a production sharded system. Give concrete examples of alerting thresholds (e.g., CPU > 80% for 5m, shard QPS 3x cluster median, tail latency deviation) and propose remediation actions that could be automated.

HardTechnical
92 practiced

Tail latency spikes increased after increasing shard count. Outline how you would diagnose root causes (network issues, coordination overhead, compaction/GC, metadata lookups), which tools and traces you'd use, and what optimizations you would try to reduce tail latency in a sharded datastore.

MediumTechnical
72 practiced

You receive reports of stale reads for a small percentage of users. Outline a step-by-step troubleshooting plan to identify root cause: what logs, traces, metrics, and checks would you run; how to reproduce; and how to validate whether the issue stems from replication lag, caching, DNS, or client behavior.

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.