Biggest Weekly Rank Climbers in the Trending Reels Audio Chart

Last updated: November 29, 2026

Quick Overview

Rank Reels audio tracks by weekly uses within each week, then find the ten tracks with the largest rank improvement versus the immediately preceding week. Tracks absent from the previous week's chart are not climbers.

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

0

0

0 solved


Rank Reels audio tracks by weekly uses within each week, then find the ten tracks with the largest rank improvement versus the immediately preceding week. Tracks absent from the previous week's chart are not climbers.

Trending audio is a core Reels discovery surface, and Meta interviewers like rank-change questions because they need two window functions stacked in the right order. They are checking that you rank first, then LAG the rank, and that you only compare truly adjacent weeks.

What the Interviewer Expects
  • Aggregates audio uses to audio by week
  • Ranks within each week before computing change
  • Uses LAG on both rank and week to confirm the prior row is exactly one week earlier
  • Defines improvement as previous rank minus current rank
  • Handles ties in the final top ten deliberately
Key Topics to Cover
RANK
LAG
stacked window functions
adjacent periods
leaderboards
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 restrict the chart to the top 200 each week, so a track jumping from 5,000 to 4,000 does not count?
  • How would you compute the number of consecutive weeks a track has stayed in the top 50?
  • Would you rank on raw uses or on uses per unique creator, given spam remixes? Why?
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: reel_audio_uses(reel_id, audio_id, creator_id, published_at). One row per Reel that used the audio. I will define a 'use' as a published Reel and weeks as Monday-start. Only tracks with at le...

Approach
  1. Weekly uses per audio.
  2. RANK() within week by uses descending.
  3. Per audio, LAG(week_rank) and LAG(week_start) ordered by week.
  4. Keep rows whose previous week is exactly seven days earli...

Submit Your Answer
Markdown supported