Reported interview periodNot available
Disk-backed map
Build a map whose values survive a process crash. A memory-only map does not meet the contract.
Practice focusget returns the stored value or nothing. put stores a pair and must reach disk before it returns. Startup reads the file and rebuilds the map. A torn or partial final line is ignored. Requirements - Part one is an append-only log. Each put adds one line. Startup replays the file. Never rewrite a line in place. - An update of an existing key appends a newer line. Replay keeps the last complete line for that key. - A second process that opens the same path must see committed values. - Part two is compaction.…