Back to problems

In-Memory Key-Value Store with Nested Transactions and Value Counts

Object-Oriented Programming · Anthropic · Hard

Design an in-memory key-value database that allows nested transactions and supports counting of values. The database starts with no entries. You must process a sequence of commands, one per line, following the rules below. Commands (command names are case‑insensitive; e.g., set and SET are equivalent) SET key value – create or update the mapping for key to value. If the key already exists, its old value is replaced. This command produces no output. GET key – retrieve the…

Checking your access…