Design a near-real-time weather API
Company: HubSpot
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Design a weather data platform that retrieves best-effort hourly dumps from an external Weather Service API for approximately 2,000 locations across the country and exposes an API to return the current temperature for a requested location. Requirements: data served must be at most 10 minutes stale; the system should gracefully handle upstream API slowness, partial failures, and outages; support retries, idempotent ingestion, and backfill of missed hours; respect provider rate limits; provide monitoring/alerting on freshness SLOs; and support horizontal scale for traffic spikes. Deliverables:
(
1) a high-level architecture (ingestion, storage, cache, API, scheduler),
(
2) API design (e.g., GET /temperature?locationId=..., response schema, error and freshness metadata),
(
3) data model and storage choices (including TTL/indexing strategies),
(
4) caching and invalidation plan to meet the 10-minute freshness,
(
5) deployment, cost, and security considerations, and
(
6) test and observability strategy.
Quick Answer: This question evaluates system design competencies such as real-time data ingestion, API design, caching and invalidation, storage modeling and indexing, reliability under upstream slowness, idempotent retries and backfill, rate-limit handling, and observability for freshness SLOs.