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
101 practiced

Write an operational playbook for recovering from a single-shard failure that causes read/write errors for a subset of users. Include detection, immediate mitigation steps, data integrity checks, and post-recovery validation steps relevant to a sharded SQL database.

HardTechnical
73 practiced

Design a strategy to perform schema changes across a sharded cluster (e.g., adding a nullable column to orders). Requirements: minimize downtime, avoid cross-shard inconsistencies, and support rollback. Outline steps and tooling you'd use.

HardSystem Design
103 practiced

Design an automated failover system for primary-replica database pairs that minimizes split-brain risk. Cover health checks, fencing mechanisms, promotion safety checks, and how you would validate and audit automatic promotions. Also explain what data can be lost during the failover and how RPO and RTO differ between manual and automatic failover.

HardSystem Design
102 practiced

Design a zero-downtime re-sharding strategy (changing shard key or increasing shard count) for a primary events table expected to grow from 100TB to 800TB. Include steps for data migration, dual-write patterns, backfill, cutover, consistency guarantees during cutover, automated rebalancing, and rollback paths. Explain operational concerns such as migration bandwidth, impact on latency, and verification of data correctness.

HardTechnical
101 practiced

Explain how database-level replication lag can affect read-after-write consistency in systems using read replicas. As a data engineer, describe patterns to ensure users see their own recent writes (for example, sticky sessions, session routing, read-your-writes guarantees) and trade-offs involved.

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.