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.

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.

MediumTechnical
81 practiced

Explain database federation as an alternative to sharding: querying across multiple independently-owned databases without redistributing their data. Describe one scenario where federation is preferable to sharding, and one where federation introduces unacceptable complexity.

HardTechnical
91 practiced

Your distributed database cluster is showing growing WAL (write-ahead log) shipping and apply lag on replicas during peak traffic, and downstream consumers are seeing stale reads. Walk through a remediation plan that addresses network bandwidth, replica IO throughput, and replica apply configuration, and states what level of read staleness you would accept for which consumers. Include both short-term mitigations and longer-term architectural fixes.

HardTechnical
95 practiced

How would you detect and mitigate silent data corruption or a split-brain scenario in a replicated database? Propose detection mechanisms, automated mitigation steps, and offline repair procedures that preserve data correctness.

MediumTechnical
79 practiced

A single PostgreSQL table receives millions of inserts per minute and experiences write hotspots on a monotonically increasing primary key (serial). This causes contention and slows ingestion. As a data engineer, propose architectural and database-level changes to eliminate hotspots and increase throughput while preserving insert order where necessary. Consider alternatives like partitioning, UUIDs, batching, or using a distributed write service; explain pros and cons.

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.