Day-Thirty Retention by the First Surface Used in Instagram
Last updated: November 29, 2026
Quick Overview
For new Instagram users, determine which surface (Feed, Reels, Stories, Explore or DMs) they spent the most time on in their first session, then report Day-30 retention by that first surface, using activity on days 28 through 34 after signup as the retention window.
Meta
November 29, 20260
0
0 solved
For new Instagram users, determine which surface (Feed, Reels, Stories, Explore or DMs) they spent the most time on in their first session, then report Day-30 retention by that first surface, using activity on days 28 through 34 after signup as the retention window.
Instagram product analytics often asks which early experience predicts long-term retention, for example whether users who start in Reels stick around. The interviewer checks session-level aggregation, tie breaking with ROW_NUMBER, a windowed retention definition, and that you avoid reading the result as causal.
What the Interviewer Expects
- Isolate the first session per user
- Pick the top surface by time with deterministic tie breaking
- Use a 7-day window around day 30 to reduce day-of-week noise
- Left join so non-retained users count
- State that the comparison is correlational
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 acquisition channel or country?
- How would you test causally whether starting in Reels improves retention?
- What if the first session is very short and has no surface time logged?
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
users(user_id, signup_date), surface_time(user_id, session_id, session_start_ts, surface, seconds) and daily_active(user_id, ds). The first session is the one with the smallest start timestamp. ...
Approach
Rank sessions per user by start time to get session 1. Sum seconds by surface within it and keep the top surface. Then flag whether the user has any active day between signup + 28 and signup + 34. Agg...