This question evaluates a data scientist's proficiency in time-series analytics and data aggregation, focusing on computing daily active users and a 30-day rolling MAU from user and login tables, and falls under the Data Manipulation (SQL/Python) domain.
You have two tables in PostgreSQL:
users
user_id
(STRING / INT, PK)
signup_date
(DATE)
logins
user_id
(STRING / INT, FK →
users.user_id
)
browser
(TEXT)
login_ts
(TIMESTAMP) — assume UTC unless stated otherwise
2023-01-01
to
2023-12-31
), compute DAU where DAU on a day = number of distinct
user_id
that logged in on that calendar day.
date
,
dau
dau = 0
).
generate_series
).
date
,
mau_l30d