← 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 store that supports nested transactions. The store must provide the following operations: get(key), set(key, value), delete(key), begin(), commit(), and rollback(). begin() starts a new transaction layer; commit() merges the most recent transaction layer into the previous one; rollback() discards the most recent transaction layer. get() must return the value from the most recent transaction layer that contains the key, searching from the top of the stack downward. set() and delete() only affect the topmost transaction layer, leaving parent layers untouched. If a rollback or commit is attempted when no transaction is active, the operation should be ignored or handled gracefully.