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
November 29, 20260
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
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 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 ProblemsSample 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
- Weekly uses per audio.
RANK()within week by uses descending.- Per audio,
LAG(week_rank)andLAG(week_start)ordered by week. - Keep rows whose previous week is exactly seven days earli...