Gini Coefficient of Reels Watch Time Across Creators per Country

Last updated: November 29, 2026

Quick Overview

Given total Reels watch minutes per creator with country, compute the Gini coefficient of watch time concentration for each country, plus the share of watch time captured by the top 1 percent of creators, to compare how concentrated attention is across markets.

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

0

0

0 solved


Given total Reels watch minutes per creator with country, compute the Gini coefficient of watch time concentration for each country, plus the share of watch time captured by the top 1 percent of creators, to compare how concentrated attention is across markets.

Meta tracks creator ecosystem health, and a market where a few creators capture all attention is risky for the long tail. This screen question checks implementing a concentration metric with sorted cumulative sums inside groupby, numerical care with zeros, and interpretation.

What the Interviewer Expects
  • Implement Gini from sorted values with the standard closed form
  • Apply it per country with groupby
  • Compute top 1 percent share using a ceiling on the count
  • Handle groups with all zeros or a single creator
  • Interpret differences between markets without overclaiming
Key Topics to Cover
Gini coefficient
Lorenz curve
groupby apply
concentration
creator ecosystem
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 track Gini over time and attribute changes to ranking changes?
  • How does excluding creators with zero watch time change the metric?
  • What other concentration measures (HHI, Theil) would you consider?
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

w(creator_id, country, minutes), one row per creator. Creators with zero minutes are included because 'creators who got no attention' is part of the story. For n values sorted ascending $x_1 \le ......

Approach

Write gini(x) with numpy: sort, compute the weighted sum with ranks 1..n, and apply the formula. Top 1 percent share: sort descending, take ceil(0.01 n) creators (at least one) and divide their su...


Submit Your Answer
Markdown supported