📝 Problem Description
Design a weather application that shows current conditions, hourly and 10-day forecasts for any location. Support location-based weather, saved locations, and severe weather alerts.
👤 Use Cases
1.
User wants to opens the app so that sees weather for current location
2.
User wants to searches for a city so that sees weather for that city
3.
User wants to saves a location so that can quickly view that location later
4.
System wants to detects severe weather so that sends push notification to affected users
✅ Functional Requirements
- •Current weather conditions (temp, humidity, wind, UV)
- •Hourly forecast (48 hours)
- •10-day forecast
- •Weather radar/maps
- •Search locations by city name
- •Save favorite locations
- •Severe weather alerts
- •Air quality index
⚡ Non-Functional Requirements
- •Weather data updated every 15 minutes
- •App load time < 2 seconds
- •Support 100M daily users
- •Global coverage (all countries)
⚠️ Constraints & Assumptions
- •Weather data comes from external providers (NWS, ECMWF)
- •Radar images are large (tens of MB)
- •Different data sources for different regions
📊 Capacity Estimation
👥 Users
100M DAU
💾 Storage
~10TB (weather data cache, user preferences)
⚡ QPS
Reads: 50K/sec, Updates: ~1K locations every 15 min
🌐 Bandwidth
100TB/day (mostly weather images)
📐 Assumptions
- • 100M daily active users
- • Average 5 weather checks per user per day
- • ~100K unique locations worldwide
- • Data refresh every 15 minutes
💡 Key Concepts
HIGH
Data Normalization
Different providers use different formats, units, and update frequencies. Normalize to common schema.
CRITICAL
Caching Strategy
Weather data refreshes every 15 min. Cache heavily with appropriate TTL.
HIGH
Geocoding
Convert city names to lat/lon and vice versa for location resolution.
MEDIUM
Geo-based Alerting
Match severe weather polygons with user locations for targeted alerts.
💡 Interview Tips
- 💡Emphasize data is from external sources
- 💡Caching is critical - weather doesn't change every second
- 💡Discuss geocoding for location resolution