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
Data Manipulation (SQL/Python)
Data Scientist
Meta
November 29, 2026
Data Scientist
Onsite
Data Manipulation (SQL/Python)
Medium

0

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
ROW_NUMBER
LEAD
position analysis
survivorship bias
Reels ranking
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. 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 Problems
Sample 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
  1. ROW_NUMBER() per session gives position.
  2. LEAD(view_id) per session is NULL on the last view, so is_last is a simple check.
  3. Bucket positions above 20 as 21.
  4. Aggregate by bucket: views...

Submit Your Answer
Markdown supported