KatInterview

Hardware Metrics Pipeline: Ingest, Store, and Query at Scale

System DesignModel answer
MediumModel answerSystem Designtime-seriesobservabilitydata-pipeline

Last updated

Design an end-to-end telemetry platform that collects per-device metrics at two resolutions, serves trend dashboards, supports raw drilldowns, and safely exposes a natural-language query interface.

Hardware Metrics Pipeline: Ingest, Store, and Query at Scale

You are asked to design a platform that continuously collects performance metrics from a large fleet of compute accelerators and makes those metrics available for both long-range trend analysis and deep per-device investigation.

Requirements

  • A collection agent must produce two streams: one sample every 30 seconds and one sample every 1 second.
  • Operations staff need a dashboard showing three months of trend data.
  • During incidents, staff must be able to drill down to raw one-second detail for a single device.
  • The analytics layer may later be extended with a natural-language SQL interface. That interface must respect per-user data permissions and must not allow generated queries to read data the user cannot see or to trigger runaway scans.

Constraints and Assumptions

  • Treat this as an observability platform, not a model-training or feature-store problem.
  • You may assume: collection agents on each host, a message broker, a durable data lake or warehouse, and an internal dashboard frontend.
  • State your own scale assumptions; keep them approximate unless numbers are given.
  • Optimize for data correctness, operational simplicity, and cost control.

Good Clarifying Questions

  • How many hosts and devices are in scope today, and what is the expected growth rate?
  • Which metrics are required (utilization, memory, thermals, error counters, power, job/tenant ownership)?
  • How long must one-second raw data be retained versus the coarser aggregates?
  • Are dashboards internal-only, customer-facing, or subject to compliance requirements?
  • What identity and access-control system already exists across teams and tenants?

Part 1 — Collection and Ingestion

Explain how metrics travel from the device to durable storage. Cover: agent design, local buffering and retry, schema evolution, deduplication, and how the system behaves when a host or the network fails.

Part 2 — Storage Layout and Query Serving

Design the storage tiers and query path that support both three-month trend dashboards and per-second incident investigation. Address partitioning, precomputed rollups, query routing, and how late-arriving data is handled.

Part 3 — Access-Controlled Natural-Language Query Interface

Describe how you would extend the platform with a natural-language-to-SQL assistant. Focus on enforcing data access rules, preventing the model from generating dangerous or expensive queries, and where each control must live.

Hints

Hint 1

Estimate the raw data rate before designing anything else — the volume gap between 1-second and 30-second data drives almost every storage and cost decision downstream.

Hint 2

The 1-second stream and the trend stream have opposite access patterns: raw data is written constantly but read rarely, while rollups are read constantly but written infrequently. Design them as separate physical tiers rather than filtering a single table.

Hint 3

For the SQL assistant, never rely on a prompt to enforce access control. The warehouse engine must enforce permissions independently of whatever SQL the model generates.