Back to problems

Implement an Internal Database

Object-Oriented Programming · Tradedesk · Hard

Problem Statement Create an in-memory database that provides the operations below. Level 1: set(timestamp: int, key: str, field: str, value: int): At the specified timestamp, assign an integer value to a field under a key. get(timestamp: int, key: str, field: str, value: int): Retrieve the value associated with a field at the provided timestamp. compare_and_set(timestamp, key, field, expected_value, new_value): Replace the field's current value with new_value only when it…

Checking your access…