Newyorktimes·Data Analyst·Technical Phone Screen
- Given a page_views table, compute the number of distinct content IDs viewed and the total view events for each device group (mobile vs desktop). Also explain whether those two numbers will typically be equal.
- For each device type (phone, tab, desktop), find the top 3 hours of day by view volume. Break ties by preferring the earlier hour.
- From the same table, return two numbers: the count of distinct non-null content IDs ever viewed, and the count of events where content_id is null.
- For each agent and each calendar date, identify their first page view of that day using earliest timestamp and smallest view_id as a tiebreaker. Then compute the distribution of first-seen content types across all agent-days, including each type's share of total agent-days per date.
“Pretty straightforward GROUP BY with a CASE to bucket phone and tab together as mobile.”