Skip Rate by Position Within a Reels Viewing Session
Last updated: November 29, 2026
Quick Overview
Given Reels view events grouped into sessions, compute the skip rate (watched under two seconds) at each position in the session from 1 to 20, plus a combined bucket for positions beyond 20, and the share of views at each position that were the session's last.
Meta
November 29, 20260
0
0 solved
Given Reels view events grouped into sessions, compute the skip rate (watched under two seconds) at each position in the session from 1 to 20, plus a combined bucket for positions beyond 20, and the share of views at each position that were the session's last.
Reels ranking teams at Meta care about where in a session people start skipping, since it hints at fatigue or weak lower-ranked candidates. The interviewer checks ROW_NUMBER for position, LEAD to detect the last view, and awareness that late positions only exist in long sessions.
What the Interviewer Expects
- Numbers views within each session with ROW_NUMBER
- Defines skip with an explicit threshold on watch time
- Uses LEAD to identify the last view in the session
- Buckets the long tail of positions
- Calls out survivorship bias: late positions come from engaged users
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 survivorship, for example by restricting to sessions with at least 20 views?
- Should skip be defined relative to Reel length? How would the query change?
- How would you compare skip-by-position curves between two ranking model variants in an A/B test?
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
Table: reels_views(view_id, session_id, user_id, reel_id, started_at, watch_ms). Sessions are already built upstream. A skip is watch_ms < 2000. I order views within a session by `started_at, view...
Approach
ROW_NUMBER()per session gives position.LEAD(view_id)per session is NULL on the last view, sois_lastis a simple check.- Bucket positions above 20 as 21.
- Aggregate by bucket: views...