Daily iOS
iOS system design

Weather app design

Design an app that shows the weather for the current location and favorite cities. Focus on the components, the data sources, and the cache and refresh policy.

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Split into LocationProvider, WeatherAPI, WeatherStore (cache plus TTL), and a view model, cache responses on disk under a location grid key, and show them stale-while-revalidate. Schedule background refresh with BGAppRefreshTask, on the assumption that it runs at the system's discretion.

Share a question