Back to problems

Timestamped Key-Value Store

Algorithm · Amazon · Easy

Maximum-Timestamp Key-Value Store Easy · Topics · Company Tags · Hints Design a class that supports two operations: set and get. The set method accepts three arguments: a timestamp (int), a key (string), and a value (int). It records that the given key maps to the given value at the specified timestamp. However, the class must always maintain only the record with the highest timestamp seen so far for each key: If the key has no previous record, or the new timestamp is…

Checking your access…