← 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 transactional key-value store that supports the following commands:
SET key value – Set a key to a value.GET key – Return the current value for the key, or null if the key does not exist.DELETE key – Remove the key from the store.COUNT value – Return the number of keys that map to the given value.BEGIN – Start a new transaction.COMMIT – Commit all changes made in the current transaction and all nested transactions, making them permanent.ROLLBACK – Abort the current transaction and all nested transactions, discarding their changes.Transactions can be nested. Each BEGIN creates a deeper nesting level. COMMIT or ROLLBACK always affect the innermost open transaction. Changes inside a transaction are visible to subsequent commands inside the same transaction but are not visible outside the transaction until it is committed. If a key is modified or deleted inside a transaction, the previous value is remembered so that ROLLBACK can restore it. All commands are case-insensitive. You may assume that all inputs are syntactically valid.