Determine Country with Most 'Sunny' Days
Company: Capital One
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Onsite
Overview: This question evaluates proficiency in data aggregation, grouping, and filtering to summarize categorical time-series records using SQL or equivalent Python data-manipulation tools, and it belongs to the Data Manipulation domain with an emphasis on practical application of query and aggregation techniques.
Tables
Weather(country VARCHAR, date DATE, weather VARCHAR)
Hints
- Aggregate counts per country with SUM(CASE WHEN weather = 'sunny' THEN 1 END).
- Compute the maximum sunny_days and filter the aggregated results to only those rows with that maximum, so all ties are returned.