Bounded Versus Unbounded Day-Seven Retention for Facebook Group Joiners
Last updated: November 29, 2026
Quick Overview
For users who joined their first Facebook Group, compute both bounded Day-7 retention (visited the group exactly on day 7) and unbounded Day-7 retention (visited on day 7 or any later day), per join week.
Meta
November 29, 20260
0
0 solved
For users who joined their first Facebook Group, compute both bounded Day-7 retention (visited the group exactly on day 7) and unbounded Day-7 retention (visited on day 7 or any later day), per join week.
Meta interviewers like to test whether a candidate knows that retention has several definitions and that the choice changes the number a Groups team reports. The check is precise date logic, one row per user, and a clear explanation of when each metric fits.
What the Interviewer Expects
- Identify each user's first group join as the cohort event
- Compute bounded and unbounded flags in the same pass
- Aggregate flags per user before averaging
- Explain why unbounded is always greater than or equal to bounded
- Exclude users whose day 7 is in the future
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- Which definition would you use for a weekly-use product like Groups, and why?
- How would you add a rolling window version such as active any day 7 to 13?
- What happens if a user leaves the group and joins another?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
group_joins(user_id, group_id, join_ts) and group_visits(user_id, group_id, visit_ts). The cohort event is the user's first ever join. A return means visiting the same group. Day offsets are calen...
Approach
Find the first join per user with ROW_NUMBER. Join visits on user and group with an offset d = date_diff('day', join_date, visit_date). For each user take MAX(d = 7) as the bounded flag and `MAX...