Applied Intuition·Software Engineer·Technical Phone Screen
- Design and implement an in-memory key-value store that supports transactions and arbitrarily nested transactional blocks. The system should handle SET, GET, BEGIN, ROLLBACK, and COMMIT commands, where ROLLBACK discards the current transaction's changes and COMMIT merges all open transactions into the base state. Also discuss the time and space complexity of each command, compare a stack-based versus recursive approach for managing nested transactions, and walk through example interactions including edge cases like GET on a missing key or ROLLBACK with no open transaction.
“This one took me a second to parse because it sounds like a database question but it's really a stack management problem.”