Nuro: Versioned key-value store with rollback delete under concurrency
Problem. Design a versioned key-value store with three operations. put writes a value for a key at a new version. get(key, version) returns the value whose version is closest to the requested one. delete(version) removes every entry written after that version and keeps the earlier ones.
Discussion in the round. The candidate suggested a tree map per key. The interviewer felt that was too costly and suggested an append-only list with binary search, since versions grow over time and a rollback just truncates the tail.
Follow-up. How do you stop race conditions when many threads read and write? A single lock, then a read-write lock, were offered; the interviewer was steering toward multi-version concurrency control, where readers see a stable snapshot while writers add new versions.
The candidate ran out of time before writing code.
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.