Share of Instagram Story Viewers Who Watched Every Frame in Order

Last updated: November 29, 2026

Quick Overview

For each Instagram account's daily story set, compute the share of viewers who saw every frame and the share who saw every frame in posting order, using frame view logs that can include rewatches.

Meta
Data Manipulation (SQL/Python)
Data Scientist
Meta
November 29, 2026
Data Scientist
Onsite
Data Manipulation (SQL/Python)
Hard

0

0

0 solved


For each Instagram account's daily story set, compute the share of viewers who saw every frame and the share who saw every frame in posting order, using frame view logs that can include rewatches.

Stories completion is a core engagement signal for Instagram, and 'in order' is subtle because viewers tap forward, back and rewatch. The interviewer checks frame positions with ROW_NUMBER, total frames with COUNT OVER, deduplicated first views, and a clean in-order test.

What the Interviewer Expects
  • Assigns each frame its position within the author's daily set with ROW_NUMBER
  • Attaches the set size with COUNT(*) OVER the same partition
  • Deduplicates rewatches by taking each viewer's first view per frame
  • Numbers each viewer's frames by first-view time and compares with frame position
  • Separates 'saw all frames' from 'saw all frames in order'
Key Topics to Cover
ROW_NUMBER
COUNT OVER
sequence matching
deduplication
Stories completion
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 define a story set when frames posted late at night spill past midnight?
  • How would you compute the drop-off curve: share of viewers who reached frame k?
  • How would you treat views that came from a share in DMs rather than the story tray?
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

Tables:

  • story_frames(frame_id, author_id, posted_at)
  • frame_views(viewer_id, frame_id, viewed_at), one row per view including rewatches.

A story set is the author's frames posted on the same c...

Approach
  1. Frame position and set size: ROW_NUMBER() and COUNT(*) over (author_id, set_date).
  2. First view per (viewer, frame) with MIN.
  3. Join, then ROW_NUMBER() per (viewer, author, set_date) ...

Submit Your Answer
Markdown supported