A two-proportion test, from counts to a launch call
One OpenAI senior data scientist candidate reports a take-home that asked how you'd define success metrics and decide whether the launch was a success (1 report). Airbnb asks it in other words: a prep site lists Airbnb screens that say "Recommend whether to launch based on an experiment you design" (1 source), and that ask you to design and then analyze an experiment for a luggage locker feature (1 source). Our version reads like this:
We split users at random between the current page, A, and a new one, B. A converted 200 of 2,000 users, and B converted 250 of 2,000. Write
two_proportion_test(conv_a, n_a, conv_b, n_b, alpha=0.05, share_b=0.5). Return B's rate minus A's, the z statistic, a two-sided p-value, a1 - alphaconfidence interval for the gap, and whether the split itself missed its plan. Then tell me: do we launch?
The practice comes in four levels, each one a key in the dict the function returns. Level 1 returns diff, B's rate minus A's, and z, with the standard error the null predicts. Level 2 adds p_value, two-sided. Level 3 adds ci, the interval, with each group's own standard error. Level 4 adds srm, which flags a split that missed share_b, the share of users the plan sent to B.
You don't write it yet. The lesson reads a test in the order you'd read a real one: check the split, ask what chance alone could do, build the test and the interval, then make the call and answer the follow-ups. At the end you solve the whole problem, level by level, in an interview simulation with a 35-minute timer.
The sample-size lesson comes next. It plans a test before it runs: how many users the test needs to detect the lift you care about.