Weekly Active WhatsApp Users by ISO Week and Platform

Last updated: November 29, 2026

Quick Overview

Using a daily activity table, count weekly active WhatsApp users for each ISO week, broken down by platform (Android, iOS, Web) and also as an overall total. A user active on two platforms in a week counts once in the total.

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

0

0

0 solved


Using a daily activity table, count weekly active WhatsApp users for each ISO week, broken down by platform (Android, iOS, Web) and also as an overall total. A user active on two platforms in a week counts once in the total.

A warm-up SQL question in Meta data science phone screens, using WhatsApp's multi-device setup as the twist. The interviewer checks DATE_TRUNC to week, COUNT DISTINCT, and whether you know that platform counts do not add up to the total.

What the Interviewer Expects
  • Truncate dates to the ISO week start (Monday)
  • Count distinct users, not rows
  • Produce the total with a separate distinct count or GROUPING SETS
  • Explain why platform rows sum to more than the total
  • Flag the current partial week
Key Topics to Cover
DATE_TRUNC
COUNT DISTINCT
GROUPING SETS
weekly actives
partial periods
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 get rolling 7-day actives instead of calendar weeks?
  • Why might WAU for the week be lower than the sum of daily actives?
  • How would you approximate this at WhatsApp scale?
  • What if users' local weeks matter more than UTC weeks?
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

whatsapp_activity(user_id, ds, platform), one row per user, day and platform where the user sent or read a message. ds is a UTC date. ISO weeks start Monday, which is what Presto's `DATE_TRUNC('we...

Approach

Group by week and platform, counting distinct users. For the total, the platform counts cannot be summed because one person on phone plus web would be counted twice, so I use GROUPING SETS to compute ...


Submit Your Answer
Markdown supported