Design a Multi-Provider Weather Forecast Service
Design current and seven-day forecast reads across unreliable third-party providers.
Problem statement
For this exercise, assume authenticated users request today's weather and a seven-day forecast for a supported location.
The service integrates multiple third-party weather providers, normalizes their responses into one public forecast model, and may fall back to another healthy provider when the preferred provider is unavailable. Forecasts may be cached within explicit freshness windows.
Historical analytics, severe-weather emergency dispatch, and training a forecasting model are outside scope.
What to build
- An authenticated user can read normalized current conditions for a supported location with the observation time and provider freshness.
- An authenticated user can read a normalized seven-day forecast with one stable public schema.
- The service can fall back to another healthy provider without returning mixed-schema or silently stale data.
At scale
- For this exercise, assume 20,000 forecast reads per second at peak across 2 million actively queried locations.
- For this exercise, target 400 milliseconds p95 for cached reads and 1.5 seconds p95 when a provider call is required.
- For this exercise, current conditions may be cached for five minutes and daily forecasts for thirty minutes, with freshness disclosed in the response.
- For this exercise, each provider has a tenant-wide rate limit and may return errors, time out, or temporarily disagree with another provider.