KatInterview

Comparing Ad Distribution Models: Random vs. Deterministic Placement

Statistics & ExperimentsModel answer
MediumModel answerStatistics & Experimentsprobabilityvariancebinomial-distribution

Last updated

Analyze two ad-serving approaches for a content feed: probabilistic per-item insertion versus fixed-quota allocation.

You're designing an ad-serving system for a social media feed containing 100 pieces of content.

Your team is evaluating two approaches:

Approach 1: Each piece of content has a 4% chance of being replaced with an ad, independently.

Approach 2: Divide the feed into consecutive groups of 25 items each, and place exactly one ad in each group.

For both approaches, answer the following:

  1. What are the expected number of ads and the variance in ad count?
  2. What is the probability that a user sees more than 8 ads (double the target)?
  3. What is the expected number of times two ads appear consecutively? Which approach is more prone to creating long sequences of multiple ads in a row?

Explain your reasoning and discuss the product implications of each approach.

Hints

Hint 1

For the probabilistic method, recognize the binomial distribution and use its standard formulas

Hint 2

The quota-based method produces a fixed total; think about what that means for variance

Hint 3

Use indicator random variables and linearity of expectation to count adjacent ad occurrences