Daily Share of Ad Revenue From the Top One Percent of Advertisers

Last updated: November 29, 2026

Quick Overview

For each day, compute what share of total Meta ads revenue came from the top 1% of advertisers by that day's revenue, then add a 7-day rolling version of the share. The top group is recomputed each day.

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

0

0

0 solved


For each day, compute what share of total Meta ads revenue came from the top 1% of advertisers by that day's revenue, then add a 7-day rolling version of the share. The top group is recomputed each day.

A concentration metric that comes up in Meta ads analytics interviews, where leadership watches how dependent revenue is on the largest advertisers versus the long tail of small businesses. The interviewer checks per-day ranking, a precise definition of 'top 1%', and correct rolling of a ratio.

What the Interviewer Expects
  • Rank advertisers within each day
  • Define the cutoff as ceil(1% of advertisers active that day)
  • Sum top revenue and total revenue per day
  • Roll the ratio as a ratio of rolling sums
  • Discuss ties at the cutoff
Key Topics to Cover
ROW_NUMBER
concentration
daily ranking
ratio of sums
ads revenue
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
  • Should the top 1% be fixed from a reference period instead of daily?
  • How would you show the full Lorenz curve or a Gini coefficient?
  • Why could this share rise even if large advertisers spent less?
  • How would you treat agencies that manage many advertiser ids?
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

ads_revenue_daily(advertiser_id, ds, revenue_usd), one row per advertiser per day with revenue above zero. Top 1% means the highest-revenue ceil(0.01 * n) advertisers that day, where n is the numb...

Approach

Per day, number advertisers by revenue descending with ROW_NUMBER and get n with a window COUNT. Flag the top group, aggregate to day level with a conditional sum and a total. For the rolling share I ...


Submit Your Answer
Markdown supported