Code RoomLSM-tree metrics database
HardPrep Room Coding #3148

LSM-tree metrics database

System designAlgorithms & data structuresSenior–Staff~50 min

Design the LSM-tree storage engine for a time-series metrics database ingesting 4M data points/sec across 50k active series, with a read pattern dominated by recent-window range scans (last 1h) but occasional historical scans over 90 days. Writes are append-heavy and roughly monotonic in timestamp per series; the SLA is sub-50ms p99 for recent-window reads and bounded disk usage with a 14-day hot tier on NVMe and a cold tier on object storage. Walk through the memtable/SSTable layout, the compaction strategy, and how you keep read amplification low for recent windows while controlling write amplification.

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:30 left
Estimate5:30 planned
Design16:30 planned
Deep dive13:30 planned
Failure9:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.