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

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.

HardSystem Design
75 practiced

Design a query routing layer for a sharded database. Compare client-side routing, a proxy/router, and a smart ORM in terms of latency, maintainability, and deployability. Explain how you'd handle stale mappings and configuration rollouts safely in production.

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.

HardSystem Design
71 practiced

Explain how to obtain a consistent point-in-time snapshot across multiple shards for backup or analytics without stopping writes. Discuss algorithms such as distributed snapshot via global logical timestamps/epochs, MVCC-based snapshots, and coordinator-driven snapshot epochs; explain how to coordinate shards to produce a consistent view.

HardSystem Design
72 practiced

Design a method to generate globally unique IDs across shards with low latency. Requirements: IDs must be sortable by time, space efficient, collision-free, and support up to 100k ID generations/sec across the cluster. Discuss approaches like Twitter Snowflake, UUID variants, or centralized ID services.

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.