Design a Metrics and Monitoring System

HardInfrastructureTime-series StorageAggregationAlertingCompressionAbout 45 minutes

Design a monitoring system like Datadog or Prometheus for a company with 50,000 servers: collect metrics, store them, draw dashboards, and fire alerts. Plan for 10M data points per second and queries over the last 15 months.

How the interview goes

Five phases, and questions the interviewer is likely to ask in each.

  1. 1. Requirements

    • What resolution is needed for last hour versus last year?
    • How quickly must an alert fire?
    Show a hint

    Estimate active series, not just points per second.

  2. 2. High-level design

    • What sits between agents and storage?
    • How is a query for 'p99 latency by region' answered?
    Show a hint

    Absorb spikes between the agents and storage.

  3. 3. Deep dive

    • How do you compress timestamps and values?
    • What happens when someone adds a request_id tag?
    Show a hint

    Consecutive points in a series are similar, which compresses very well.

  4. 4. Scaling

    • How do you shard writes and still query across shards?
    • How do you handle a burst after a network partition heals?
    Show a hint

    Old data rarely needs per-second resolution.

  5. 5. Trade-offs

    • Push versus pull collection?
    • Precompute rollups or compute at query time?
    Show a hint

    Alerts and dashboards have different reliability needs.

Practice this with an AI interviewer

Write your design doc with live diagrams while the interviewer asks one question at a time and pushes on your choices. Get a scored debrief with what to study next.

Start this interview