Time-Based Key-Value Store
Medium · Phone screen · Onsite · Full-time
Got this design question in my Lyft onsite. Build a time-based key-value store where set stores a value at a given timestamp, and get returns the value with the largest timestamp less than or equal to the query timestamp. The interviewer pushed on what happens with concurrent writes at the same timestamp and the boundary condition when the query timestamp is smaller than all stored timestamps. Took me a minute to get the binary search right.
