Code RoomLSM engine memory tuning
HardPrep Room Coding #3412

LSM engine memory tuning

System designDistributed systemsSenior–Staff~45 min

You're embedding a RocksDB-class LSM key-value engine inside a stateful service and must tune its memory budget. The box has 64GB RAM; the service process needs ~20GB, leaving ~40GB to split between the engine's block cache (serves reads), its write buffers/memtables (absorb writes before flush), and the OS page cache (serves the actual SST file reads). Workload: 200k ops/sec, 70% reads / 30% writes, value size ~2KB, working set ~15GB, p99 read latency target <5ms. Walk through how you'd partition that 40GB and which engine knobs you'd set, and what you'd measure to know you got it wrong.

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.

Clarify5:00 left
Estimate5:00 planned
Design15:00 planned
Deep dive12:00 planned
Failure8:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.