Code RoomIn-memory key-value store
MediumPrep Room Coding #3640

In-memory key-value store

System designAlgorithms & data structuresEntry–Mid~35 min

Design a simple in-memory key-value store (like a tiny Redis) for a single server, exposing GET, SET, and DELETE over a network API. It should hold a few million keys, support optional per-key TTL expiration, and survive a restart by reloading recent data. Discuss the data structures, how TTL is handled, and how you'd persist data so a crash doesn't lose everything.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.