The "In-Memory Database" problem is a classic technical interview challenge used by Snowflake to evaluate a candidate's ability to design and implement complex data structures, handle concurrency, and manage data persistence. PracHub +2 0 4 3
Design and implement a simplified In-Memory Database that supports basic data operations, transactional integrity (like BEGIN, COMMIT, ROLLBACK), and potentially advanced features like Time-to-Live (TTL) or data versioning. Snowflake Docs +1 1 0
CommandActionResult/StateSET a 10Global update{a∶10}BEGINNew transactionStack: [{}]SET a 20Update in txn{a∶20}, Undo: {a∶10}ROLLBACKRevert txn{a∶10}, Stack: []GET aLookup106 lines; Line 1: Command Action Result/State; Line 2: SET a 10 Global update the set of all a such that 10 end-set; Line 3: BEGIN New transaction Stack: open bracket the empty set close bracket; Line 4: SET a 20 Update in txn the set of all a such that 20 end-set comma Undo: the set of all a such that 10 end-set; Line 5: ROLLBACK Revert txn the set of all a such that 10 end-set comma Stack: open bracket close bracket; Line 6: GET a Lookup 10 end-lines;CommandActionResult/StateSET 𝑎 10Global update{𝑎∶10}BEGINNew transactionStack: [{}]SET 𝑎 20Update in txn{𝑎∶20}, Undo: {𝑎∶10}ROLLBACKRevert txn{𝑎∶10}, Stack: []GET 𝑎Lookup10
The "In-Memory Database" interview question requires building a system that can manage key-value pairs with nested transaction support. The primary technical challenge lies in efficiently managing the stack of transactions so that ROLLBACK and COMMIT operations correctly restore or finalize state without degrading the 𝑂(1) performance of basic GET and SET operations.
Would you like a sample implementation of this database in a specific programming language like Python or Java?
[0] - PracHub - Practice Tech Interview Questions (Updated 2026) [1] - Transactions - Snowflake Documentation [2] - 18 Java scenarios based interview Questions and Answers [3] - Anthropic Coding & Algorithms Questions (Updated 2026) - PracHub [4] - Software Engineer Coding & Algorithms Interview Questions ...