Code RoomCrash-consistent copy-on-write B+tree
HardPrep Room Coding #3426

Crash-consistent copy-on-write B+tree

System designDatabases & SQLStorage & CDNSenior–Staff~50 min

Design a single-node embedded storage engine that achieves crash-consistency WITHOUT a traditional write-ahead log — a copy-on-write B+tree (LMDB/Btrfs-class) where updates never overwrite live pages. Requirement: after any crash (even mid-write), the database opens at the last fully-committed state with no recovery scan, supporting many concurrent readers that never block the single writer and never see a torn page. Walk through how a write commits atomically by writing new pages and flipping a root, how readers get a stable snapshot, and the space cost this design pays.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify5:30 left
Estimate5:30 planned
Design16:30 planned
Deep dive13:30 planned
Failure9:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.