Code Room
System designHardsd-g168
Subject Time series dbLevel Senior–Staff~45 minCommon in Databases & SQL interviewsIndustries Technology

Question

Design the distributed query engine for a time-series database holding 5 years of data across hundreds of storage nodes. Typical queries: 'p95 latency per service over the last 7 days, 1-minute resolution' and 'top 20 hosts by CPU this month'. A single such query can touch billions of points across many shards. You need interactive (<2s) responses for recent-data queries and bounded resource use so one heavy query doesn't take down the cluster. Design query planning, distribution, aggregation push-down, and cost control.

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.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.