System Design Prompt
Design an in-memory/disk-backed key-value store that supports transactions.
Functional requirements
-
Basic operations:
Get(key)
,
Put(key, value)
,
Delete(key)
-
Transactions:
-
Begin()
-
Commit()
-
Rollback()
-
Multiple concurrent clients.
Transaction semantics (clarify in interview)
-
At minimum: atomicity and isolation within the store.
-
Define isolation level target (e.g., Read Committed or Snapshot Isolation).
Non-functional requirements
-
Reasonable performance under concurrent access.
-
Durability (optional depending on scope): data survives crashes.
-
Support for large datasets (may exceed memory).
Deliverables
-
APIs
-
Data model and storage layout
-
Concurrency control approach
-
Crash recovery approach (if durability is required)
-
Complexity and key trade-offs