← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Implement a persistent key-value store that supports custom length-prefixed serialization and deserialization. Keys and values are arbitrary strings (they may contain any characters including newlines). Your KVStore class must provide set(key, value) and get(key) operations and be able to persist its entire state to disk on command and restore that state back into memory on startup. You must implement your own serialization format—do not use built-in libraries such as json, pickle, etc. The on-disk format should be compact and deterministic: the same in-memory contents always produce the same byte sequence. Handle empty dictionaries, None values, and special characters correctly.