Back to problems

Design a time-versioned key-value store and find common free time

Object-Oriented Programming · Meta · Medium

Task 1: Time-Versioned Key-Value Store Approach 1: Per-Key History with Reverse Scan Store one history list for each key. A set call simply appends a (timestamp, value) entry. Because set timestamps are strictly increasing, each key's history is already sorted chronologically. For a get, scan from the newest entry back to the oldest. The first entry whose timestamp is less than or equal to the requested timestamp is the answer, since it is the most recent version that still…

Checking your access…