Algorithm · Amazon · Easy
Build a key-value store that keeps track of versions, where every write is stamped with a timestamp. Implement process_operations(operations), which applies a sequence of operations in order and returns the results produced by the read operations. Two kinds of operations exist: set(timestamp, key, value): records value under the string key, tagged with the given timestamp. get(key): yields the value that was stored for key under the greatest timestamp that key has ever…