This question evaluates a candidate's ability to implement time-indexed key-value storage, covering data structure design, versioning semantics, and algorithmic complexity for efficient reads and writes.
Implement an in-memory timestamped map.
Support these operations:
put(key, value, timestamp)
: store
value
for
key
at the given integer
timestamp
get(key, timestamp)
: return the value written for
key
at the greatest timestamp less than or equal to
timestamp
; return an empty string if no such value exists
Additional notes: