← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design and implement an in-memory key-value database that supports the following operations:
put(key, value_dict) – Insert or completely replace the record for the given key with the provided dictionary of fields. If the key already exists, overwrite it.get(key) – Return the dictionary stored under the key. If the key does not exist, return None.update(key, value_dict) – Merge the provided fields into the existing record. Any overlapping fields are overwritten; new fields are added. Return True if the key existed and the merge succeeded; return False if the key did not exist (and do nothing).find_by_field(field_name, field_value) – Return a sorted list of all keys whose record contains the given field with the given value. If no records match, return an empty list.You may assume that keys are strings, field names are strings, and field values are JSON-serializable primitives (strings, numbers, booleans). The database must reside entirely in memory; persistence is not required.