InterviewStack.io LogoInterviewStack.io

Database Architecture and Partitioning Questions

Design database architecture and partitioning strategies appropriate to workload and access patterns. Evaluate database types including relational and various NoSQL models, schema design and indexing strategies, and when to use a monolithic database versus sharding. Cover sharding approaches such as range based, hash based, consistent hashing, and directory based sharding, as well as replica topologies, read replicas, replication lag, and handling cross shard queries. Address operational concerns at scale: resharding, mitigating hot partitions, balancing data distribution, transactional and consistency guarantees, and the trade offs between availability, consistency, and partition tolerance. Include monitoring, migration strategies, and impact on application logic and joins.

MediumTechnical
55 practiced
Implement a simple consistent hashing ring in Python to map keys to nodes. Your function should support adding and removing nodes and should minimize remapping of keys. Provide pseudocode or runnable Python and describe the role of virtual nodes.
MediumTechnical
48 practiced
Design an approach to minimize cross-shard transactions by rethinking the data model. Given a social feed application with users, posts, and likes distributed across shards by user_id, propose how to move to a model that reduces cross-shard joins while preserving correctness and acceptable latency.
EasyTechnical
66 practiced
Define a hot partition (hotspot) in a sharded system, list common causes (e.g., monotonically increasing keys, tenant skew), and propose three practical mitigation techniques an on-call engineer could deploy quickly.
MediumTechnical
78 practiced
You are designing sharding for a multi-tenant SaaS product where tenants vary wildly in size (from small startups to large enterprises). Propose a sharding strategy (e.g., tenant-per-shard, shared-shard with tenant-aware routing, hybrid), describe how you'd implement tenant placement, and explain resharding policies for growing tenants.
HardSystem Design
51 practiced
Describe a resharding strategy that minimizes downtime and rebalancing impact when moving shards to new nodes. Include steps for live migration, data streaming/backfill, client routing updates, and estimating network IO during rebalancing.

Unlock Full Question Bank

Get access to hundreds of Database Architecture and Partitioning interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.