Ad Load per Feed Session Across Facebook Sessions

Last updated: November 29, 2026

Quick Overview

For each Facebook Feed session, compute ad load as ads seen per 100 feed items, then report the average session ad load and the share of sessions above a 20-percent ad load, by country.

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

0

0

0 solved


For each Facebook Feed session, compute ad load as ads seen per 100 feed items, then report the average session ad load and the share of sessions above a 20-percent ad load, by country.

A session-level metric question in the style of Meta's ads and feed data science screens, where ad load is tuned carefully against user experience. The interviewer checks that you compute the ratio per session before averaging, and that you can explain the difference from a pooled ratio.

What the Interviewer Expects
  • Computes ads and organic items per session from one events table
  • Computes the ratio per session and then averages
  • Contrasts per-session average with the pooled ratio
  • Excludes sessions with too few items to have a meaningful ratio
  • Groups by country with volume
Key Topics to Cover
ratio metrics
session-level aggregation
pooled versus mean of ratios
ad load
Facebook Feed
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
  • When is the pooled ratio the right number to report?
  • How would you look at ad load by position in the session, such as the first 20 items?
  • Why might short sessions show higher ad load?
  • How would you design a guardrail metric from this for an ads ranking test?
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

feed_impressions(session_id, user_id, country, item_type, position, ts) where item_type is ad or organic. Ad load per session is 100 * ads / (ads + organic). Sessions with fewer than 10 item...

Approach

Aggregate per session to get ads and total items, filter small sessions, compute each session's load, then aggregate per country: mean of session loads, share of sessions above 20%, and the pooled rat...


Submit Your Answer
Markdown supported