Skip to content

Design a Time-Based Key-Value Store  #15

@pratikj697

Description

@pratikj697

Implementing a time-based key-value store that supports storing values associated with keys and retrieving the value for a given key at a specified timestamp. This data structure must support two operations:

  1. set(key, value, timestamp): Store the key with the value at the given timestamp.
  2. get(key, timestamp): Return the value associated with the key at the largest timestamp that is less than or equal to the specified 3. timestamp. If there is no such timestamp, return None.

Constraints:

  1. The timestamps for set operations are strictly increasing.
  2. Keys and values are strings.

Edge Cases:

  1. If the key does not exist in the store, the function returns None.
  2. Binary search ensures we get the value closest to the requested timestamp.

Can you please assign this task to me under HactoberFest 2024.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions