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.

EasyTechnical
42 practiced

What is a B-tree index and why is it well-suited to range queries? Describe briefly how B-tree insert/delete operations maintain balance, why page splits occur, and how page splits can impact write amplification and concurrency.

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.

MediumTechnical
44 practiced

Compare LSM-tree and B-tree storage engines. Discuss differences in write/read amplification, point lookup latency, random write performance, compaction/maintenance costs, and suitability for OLTP vs analytics. Name databases that use each approach and justify their choices.

HardTechnical
40 practiced

Explain how Write-Ahead Logging (WAL) works and how crash recovery uses WAL to achieve durability. Describe the role of checkpoints and how fsync frequency and group commit impact durability, latency, and throughput. Discuss trade-offs when tuning WAL behavior for high-throughput systems.

HardTechnical
36 practiced

Design and implement a compact on-disk index for a binary log file where each record starts with an 8-byte timestamp followed by an 8-byte length. The index must locate the first record whose timestamp is greater than or equal to a target timestamp, using a sparse index to keep memory usage low. Implement the index-build routine and the sparse binary-search lookup routine.

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.