Count Ad Placements in a Ten Slot Feed With No Adjacent Ads

Last updated: November 29, 2026

Quick Overview

A feed page has 10 consecutive video slots and must contain exactly 3 ads, with no two ads in adjacent slots. How many placements are possible, how many if slot 1 must be organic, and what is the chance a random 3-ad placement is valid?

TikTok
Statistics & Math
Data Scientist
TikTok
November 29, 2026
Data Scientist
Technical Screen
Statistics & Math
Medium

0

0

0 solved


A feed page has 10 consecutive video slots and must contain exactly 3 ads, with no two ads in adjacent slots. How many placements are possible, how many if slot 1 must be organic, and what is the chance a random 3-ad placement is valid?

Combinatorics questions in TikTok screens often wrap ad load rules, and this one tests the stars and bars gap argument. The interviewer looks for a clean bijection rather than brute-force enumeration, and the ability to adjust it to added constraints.

What the Interviewer Expects
  • Uses the gap or compression argument to remove the adjacency constraint
  • Gets C(8,3) = 56
  • Adapts correctly when slot 1 is reserved
  • Computes the probability against C(10,3)
  • Generalizes to a minimum spacing of d slots
Key Topics to Cover
combinatorics
stars and bars
bijections
recurrences
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • What if ads must be at least 3 slots apart?
  • Count placements with no two adjacent ads in a circular carousel of 10.
  • How many ways if there are two distinct advertisers whose ads must alternate?
  • Can you verify the answer with a small recurrence?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Ads are identical for counting purposes (we count sets of slot positions). Slots are in a line, not a circle. Adjacent means consecutive slot numbers....

Approach

Compression: if ads sit in slots a1<a2<a3a_1 < a_2 < a_3 with ai+1≥ai+2a_{i+1} \ge a_i + 2, map them to bi=ai−(i−1)b_i = a_i - (i - 1). Then b1<b2<b3b_1 < b_2 < b_3 are any distinct values from 1 to 10−2=810 - 2 = 8, and the map is ...


Submit Your Answer
Markdown supported