Slug: design-kv-01 · Paired reading: Chapters 26 and 27
Prompt
struct Kv { wal: Vec<(String,String)>, map: HashMap<String,String> } —
set appends WAL then map; get from map; fn recover(wal) -> Kv.
Contract
setappends one WAL record then updates the map (last write wins forget)recover(wal)rebuilds the map fromwalwithout re-appending WAL entries (restored.wal == wal)- Missing keys →
None