KatInterview

Build a Scheduled Hourly Feed of Public Weather Observations

System DesignModel answer
EasyModel answerSystem Designsystem-designdata-ingestionscheduling

Last updated

Design a pipeline that polls a public weather provider for thousands of locations each hour, stores normalized history without duplicates, and serves fresh data reliably.

Problem

Your team needs an internal service that pulls weather data from a public government provider (for example, the U.S. National Weather Service API, or a comparable source) once per hour and makes it available to other teams. An external-facing API is an optional extension.

What the service must do

Functional

  1. Poll the provider every hour for every supported location (weather stations or grid points).
  2. Convert the provider's response format into one internal schema.
  3. Keep historical data so it can be queried and used for analytics.
  4. Serve the data through an API or bulk export, with a clear and predictable freshness promise.

Non-functional

  • Stay within the provider's rate limits, terms of use, and robots rules.
  • Be reliable, using retries with backoff.
  • Ingest idempotently, so retries and replays never produce duplicate records.
  • Alert when data is missing or late.

Working assumptions (you can adjust them)

  • About 10,000 locations.
  • Each location produces one new reading per hour.
  • The provider is occasionally unreliable and sometimes returns incomplete payloads.

What to cover in your answer

  1. Scheduling and crawling architecture
  2. Storage choices and schema
  3. Freshness guarantees and backfill approach
  4. Rate limiting, retry policy, and idempotency
  5. Monitoring, alerting, and data quality checks

Hints

Hint 1

Do the arithmetic first: 10,000 fetches per hour is under 3 requests per second. Let that conclusion shape how much infrastructure you propose, and spend your effort on correctness instead.

Hint 2

Find a natural key for a reading, such as (location, observed hour). If every write is an upsert on that key, retries, duplicate queue deliveries, and backfills all converge to a single row.

Hint 3

Separate fetching from parsing by storing raw responses. Also keep a task ledger of expected (location, hour) work: it drives retries, backfill, and the completeness alerts.