Which Facebook Surface Was the Last Touchpoint Before Users Went Dormant
Last updated: November 29, 2026
Quick Overview
Given Facebook app events tagged with the surface used (Feed, Marketplace, Groups, Reels and so on), write Python that finds each user's last event, splits users into dormant (no events in the last 14 days) and active, and reports which surfaces over-index as the final touchpoint for dormant users.
Meta
November 29, 20260
0
0 solved
Given Facebook app events tagged with the surface used (Feed, Marketplace, Groups, Reels and so on), write Python that finds each user's last event, splits users into dormant (no events in the last 14 days) and active, and reports which surfaces over-index as the final touchpoint for dormant users.
Facebook teams investigating churn often ask where users were when they left, as a lead for qualitative research or for a targeted experiment. The interviewer checks a single-pass last-event computation, a fair comparison group (last surface among still-active users) and a normalized index rather than raw counts.
What the Interviewer Expects
- Find each user's latest event in one pass
- Classify dormant versus active with a clear cutoff
- Compare distributions, not counts, between the two groups
- Compute an over-index ratio and handle division by zero
- Explain why this is a lead, not a cause
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
- How would you control for users who mostly use one surface anyway?
- How would you check whether a specific bad experience (for example a crash) preceded dormancy?
- How would you design a follow-up experiment from this finding?
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
Events are (user_id, timestamp, surface) with no ordering guarantee. as_of is the current timestamp. Dormant means the last event is at least 14 days before as_of. Comparing to the last surface ...
Approach
One pass builds user -> (latest_ts, surface). A second pass over users counts the last surface in each group. For each surface, compute the share among dormant users, the share among active users, a...