Design a weather API
Serve current weather and forecasts for any location to millions of apps, using data bought from upstream providers.
Functional requirements
- Get current weather for a location
- Get a 7-day forecast
- API keys with per-customer quotas
Non-functional requirements
- Responses in under 100 ms
- Data is at most 10 minutes old
- Upstream outages don’t take the service down
Scale
- 20K requests per second
- 200K distinct locations
- Upstream providers charge per call
How you’ll be scored
8 checks covering your diagram and your notes, and any valid approach counts. Hints appear for anything you miss. Common mistakes, such as single points of failure or components you never explain, cost points. How grading works
What interviewers look for
- Clarify before you draw. State what is in and out of scope. For “Design a weather API”, that starts with: Get current weather for a location; Get a 7-day forecast; API keys with per-customer quotas. Interviewers notice candidates who pin the requirements down first.
- Turn the scale into numbers. The scale (20K requests per second; 200K distinct locations; Upstream providers charge per call) should become requests per second, storage and bandwidth, and those figures should drive your choices. Estimates with units carry more weight than adjectives.
- Show how each quality is met. Your design should visibly deliver: Responses in under 100 ms; Data is at most 10 minutes old; Upstream outages don’t take the service down. Saying that it does isn’t enough; point to the part of the design that makes it true.
- Expect follow-ups on the hard parts. Interviewers usually probe caching, third-party data and read-heavy here. This is an easy problem, so interviewers expect the fundamentals done cleanly: a clear request path, the right kind of data store, and a reason for each component.
- Explain failure and trade-offs. Say what happens when a component fails, where a single point of failure would hurt, and what you chose not to build. Naming a trade-off is a stronger answer than claiming there isn’t one.