KeyValue datastore with begin,commit and rollback.
Question is the same as discussed here. It also has some good solutions in the discussion forum.
https://leetcode.com/discuss/interview-question/279913/bloomberg-onsite-key-value-store-with-transactions
You are expected to implement and run the code with a few test cases.
Please Note-> They made it very clear at the beginning that they want the code to run or there will be a reject, so please keep that in mind when you start implementing.
My advice is to run the code after writing small logic of code in incremental way to make sure that you always have an executable code and you are not inroducing bugs and making it non-runnable as running the code without exceptions is of prime importance for this company.
The solution to this question is easily available in various discussion forums.
However in short it can be implemented as the psuedo code below.
However, for senior candidates, I would recommend reading DDIA(Designing Data Intensive Applications) Chapter 3 as that will help you to understand the fundamentals behind this question.
This question can be also asked as a System Design Question in Onsite and the expectation from Senior/Staff would be to know the details explained in DDIA Chapter 3 Storage and Retrieval and bonus points if you can also explain the bits explained in Chapter 7 Transactions.