HARDVerified Real Interview• Product Data Scientist
Weekly Signup Retention Cohort Curves
Verified Source:Public Candidate Interview Report
Meta's Growth leadership tracks user retention curves across weekly signup cohorts.
Write a SQL query to calculate Day-7 Retention Rate for each weekly cohort.
A user signed up on date $D$ is defined as retained on Day-7 if they logged at least one activity between day $D+1$ and day $D+7$.
Return the cohort_week (formatted as 'YYYY-MM-DD' representing the start of the week), new_users_count, retained_users_count, and retention_rate_pct rounded to 1 decimal place.
Sort by cohort_week ascending.
Tables:
users(user_idINT,signup_dateDATE)user_activity(user_idINT,activity_dateDATE)
Execution Sandbox:
Your query executes inside an isolated in-memory PostgreSQL engine (PGlite WebAssembly). You have full access to standard PostgreSQL aggregations, window functions, and CTEs.
Standard SQL (ANSI)|Ln 1, Col 1(7 lines, 117 chars)
Tab Indent⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.