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
53 practiced
Describe directory-based sharding and sketch a simple directory service design that maps logical keys to shard instances. Include how you would handle updates to the directory, caching at the application tier, and failure modes.
MediumTechnical
65 practiced
Explain transactional guarantees across shards. Describe when to use distributed transactions (two-phase commit), when to prefer application-level SAGA patterns, and how you would decide for a payment handling microservice with multi-shard data updates.
EasyTechnical
46 practiced
Summarize common indexing strategies for partitioned or sharded databases: single-column, composite, covering, partial, and global vs local indexes. Explain when each is appropriate and the implications on query planning and maintenance.
MediumTechnical
49 practiced
Given this PostgreSQL table with high write throughput, propose a partitioning and indexing plan and provide SQL snippets for creating partitions:
sql
CREATE TABLE events (
  event_id BIGSERIAL PRIMARY KEY,
  user_id BIGINT NOT NULL,
  event_time TIMESTAMPTZ NOT NULL,
  event_type TEXT,
  payload JSONB
);
Explain your choices for partition key and indexes.
MediumTechnical
58 practiced
Propose a monitoring and alerting dashboard for a sharded database deployment. List key panels, per-shard and aggregate metrics, alert thresholds, and the runbook steps (short description) an on-call engineer should follow on high replication-lag and uneven shard CPU usage alerts.

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.