Peak Local Hour for Messenger Video Calls in Each Country

Last updated: November 29, 2026

Quick Overview

Using four weeks of Messenger video call starts, find the local hour of day with the most calls on average for each country. Convert timestamps to the country's local time first.

Meta
Data Manipulation (SQL/Python)
Data Scientist
Meta
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


Using four weeks of Messenger video call starts, find the local hour of day with the most calls on average for each country. Convert timestamps to the country's local time first.

A quick question for Messenger calling analysts, whose findings feed infrastructure capacity planning and notification timing. The interviewer checks time zone conversion, aggregation to hour of day, and argmax per group.

What the Interviewer Expects
  • Convert UTC to local time before extracting the hour
  • Average over days so the result is per-day calls
  • Pick the top hour per country with ROW_NUMBER
  • Discuss countries spanning several time zones
  • Keep ties deterministic
Key Topics to Cover
time zones
hour of day
argmax per group
AT TIME ZONE
calling
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you handle the US or Brazil with several time zones?
  • What changes around a daylight saving transition?
  • How would you compare weekday and weekend peaks?
  • How would you turn this into a capacity forecast in UTC?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

video_calls(call_id, caller_id, country, started_at) with UTC timestamps, and country_tz(country, tz_name) with one representative IANA zone per country. Period: the 28 days ending Nov 27, 2026....

Approach

Join to get the zone, convert with AT TIME ZONE, take the hour, count calls per country and hour, divide by 28 for calls per day, then rank hours within each country and keep the top one. Converting...


Submit Your Answer
Markdown supported