This question evaluates understanding of data structures and algorithmic complexity in the context of designing a key-value in-memory database, and it falls under the Coding & Algorithms domain for a Machine Learning Engineer role while focusing on practical implementation skills.
Design and implement a simple in-memory database (key-value store) that supports the following operations:
insert(key, value)
: Insert a key-value pair into the database. If the key already exists, update its value.
get(key)
: Return the value associated with the key, or indicate that the key does not exist.
delete(key)
: Remove the key and its associated value from the database if it exists.
Assume:
Requirements:
insert
,
get
, and
delete
.
Then, write code to implement these operations in the programming language of your choice.