This question evaluates a data scientist's competence in Data Manipulation (SQL/Python), focusing on SQL aggregation, joining call and user snapshot tables, temporal filtering, and computing user-level engagement metrics across incoming and outgoing call records.

You work on a Messenger-like app. You want to measure how many active users in Great Britain (GB) today have been heavy callers recently.
Assume two tables (names can vary).
callsOne row per call record.
call_id
(STRING, primary key)
caller_id
(STRING)
receiver_id
(STRING)
date
(STRING) — call date in string format (e.g.,
'2025-11-06'
)
duration
(INT) — call duration (seconds)
user_daily_statusOne row per user per day describing user attributes and activity.
user_id
(STRING)
country
(STRING)
is_active
(INT) —
1
if the user is active on that date, else
0
date
(STRING) — snapshot date in string format (e.g.,
'2025-11-06'
)
country = 'GB'
,
is_active = 1
on
today’s
snapshot date.
[today - 7 days, today - 1 day]
.
caller_id
, and
receiver_id
.
call_id
).
Write a SQL query to compute:
Return at least:
as_of_date
active_users_today
(denominator)
active_users_gt_50_calls_last_7d
(numerator)
pct_active_users_gt_50_calls_last_7d
(You may assume your SQL dialect provides a way to parse the date string into a date type.)