InterviewStack.io LogoInterviewStack.io

Database Internals and Storage Engines Questions

How databases work under the hood: storage-engine architectures (B-tree versus LSM-tree), on-disk page and buffer management, write-ahead logging, and MVCC. Covers the engine-level mechanisms that explain performance, durability, and concurrency behavior. Tests depth beyond usage — why a database behaves as it does.

HardTechnical
79 practiced

Design a mechanism to support cross-shard transactions with strong consistency and minimal latency for a sharded relational database. Compare using two-phase commit (2PC) coordinator vs distributed consensus per transaction (e.g., Paxos/Raft), list failure modes for each, and discuss how to optimize for latency while avoiding distributed deadlocks and long-tail commits.

EasyTechnical
50 practiced

Describe common transaction isolation levels: read uncommitted, read committed, repeatable read, and serializable. For each level list which anomalies they permit (dirty read, non-repeatable read, phantom reads, write skew). Which isolation level does PostgreSQL provide by default and what guarantees does it offer in practice for concurrent readers and writers?

HardTechnical
52 practiced

Plan and describe a non-blocking schema migration for adding a populated column to a 50 TB partitioned table that is distributed across hundreds of nodes. Requirements: zero or minimal impact to online queries, controlled resource usage during backfill, safe rollback path, and preservation of replica consistency. Describe tools, orchestration, throttling, and verification steps.

EasyTechnical
36 practiced

Explain synchronous versus asynchronous replication. For each approach list the implications on write latency, durability guarantees (RPO), failover complexity, and risk of data loss during master failover. Give real-world scenarios where synchronous replication is appropriate despite increasing write latency.

MediumTechnical
40 practiced

You have a Postgres table 'orders(order_id PK, customer_id, created_at timestamp, status text, total_amount numeric)'. Queries: (A) fetch recent orders for a customer sorted by created_at, (B) aggregate daily totals for analytics, (C) search by status and amount range. Propose an index strategy (including composite and partial indexes), explain trade-offs for insert overhead and disk usage, and describe monitoring to validate index effectiveness under a steady insert rate of 10k inserts/sec.

Unlock Full Question Bank

Get access to all 40 Database Internals and Storage Engines interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.