Database Internals and Storage Engines Questions

How a single database engine works internally, at the mechanism level: storage-engine architectures such as B-tree versus LSM-tree, on-disk page and buffer-pool management, write-ahead logging (WAL) and checkpointing, and MVCC's internal mechanics (version chains, vacuum and bloat, transaction-ID wraparound). Also covers compaction and its write/read amplification trade-offs, including engine-specific behavior such as Bloom filters and tombstone/TTL expiry in LSM-based stores like Cassandra, and hands-on design of simplified storage components: on-disk data layouts and indexes, WAL recovery routines, compaction strategies, and crash-safe log or queue formats. Tests depth beyond usage: why the engine behaves as it does, not how to operate, tune, recover, or scale it.

MediumTechnical
44 practiced

Discuss Bloom filters: what they solve, how false positive rate is calculated, how to choose the bit-array size (m) and number of hash functions (k) given expected element count (n) and desired false-positive probability (p), and examples of how databases use them.

HardTechnical
51 practiced

You need to support efficient binary search over a large, compressed, immutable sorted array stored on disk, without decompressing the whole thing to look up one element. How would you approach the on-disk layout and compression scheme to keep random-access latency low, and how would you design a block index over it to avoid a full scan?

HardTechnical
50 practiced

Implement a disk-backed, time-partitioned index for streaming events that supports append(event) and range_query(start_ts, end_ts), staying under a fixed memory budget. Use segment files for compact on-disk storage optimized for append speed, and include a periodic compaction step that merges segments. Explain your on-disk serialization strategy and how a range query locates the relevant segments without scanning the whole store.

HardTechnical
48 practiced

Describe how B+ trees (used for most B-tree indexes) are laid out on disk, how lookup and range scan costs are modeled (I/O per page), and the trade-offs between random and sequential I/O. Quantify (qualitatively) how page size, fanout, and clustering affect performance and memory usage.

HardTechnical
41 practiced

Your team needs to pick a storage engine for two workloads: (a) high-throughput time-series ingest, and (b) low-latency OLTP with many small updates. Walk through how a B-tree-based engine and an LSM-tree-based engine would each handle reads, writes, indexing, and compaction for these cases, discuss the operational consequences (latency, amplification, SSD wear, compaction overhead), and recommend an engine for each workload.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.