Code Room
System designHardsd-g303
Subject Storage enginesLevel Senior–Staff~50 minCommon in Databases & SQL · Storage & CDN interviewsIndustries Technology, Software development

Question

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.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.