Back to problems

Implement a versioned hash map with snapshot

Object-Oriented Programming · Lead Bank · Medium

Per-Key Write Histories with Binary Search A regular hash map only remembers the most recent value for each key. Once a key is overwritten, the previous value is gone. To support time-travel reads, we need to keep the full write timeline for every key. The key observation is that the store can maintain a strictly increasing internal clock. Since each successful put receives a larger timestamp than every previous write, appending each write as a (timestamp, value) record…

Checking your access…