Clustered standard errors, from a city-level test
A prep site lists a Netflix data science onsite question on a frequency-cap test that asks you to "provide power calculations that account for interference and clustering" (1 source), and a candidate's report of a Netflix onsite says both technical cases were about ad frequency caps (1 report). When eval questions come in related groups, like several questions about one reading passage, Anthropic recommends "clustering standard errors on the unit of randomization" (1 source). The frequency-cap question and the eval guidance use the same math. Our version of the practice reads like this:
An experiment assigned 40 whole cities to treatment or control, 20 each, then logged a metric for each of their 2,000 users. Estimate the effect, and give a standard error you'd defend. Then tell me how many cities the next test needs.
The practice comes in four levels. Level 1 writes diff_in_means and naive_se, the standard error that treats every user as independent. Level 2 writes cluster_se, clustered on city. Level 3 writes city_means_test, a t-test on one mean per city. Level 4 writes cities_per_arm, the next test's size in cities.
You don't write them yet. The lesson shows why users in one city aren't independent, measures how far that fools the naive standard error, builds the clustered one, and handles the case of few cities. At the end you solve the whole problem, level by level, in an interview simulation with a 45-minute timer.
This lesson builds on the A/B test lesson's comparison of two arms, and on the sample-size lesson's design effect. The difference-in-differences lesson comes next, for changes you can't randomize at all.