The interview problem

Practice prompt

Two ranking models score the same held-out users. You have 100,000 requests from 1,000 users and want an interval for the improvement in average user satisfaction. Design a bootstrap procedure. Explain why resampling individual requests can produce a convincing but wrong answer, and how you would handle a revenue-per-request metric instead.

Original fundamentals practice, not a reported company interview. All numbers and examples are hypothetical. Technical documentation retrieved September 27, 2026.

1. Specify what the average means

First define the population, observation window and estimand. Average satisfaction per user weights each user equally. Satisfaction averaged over requests gives frequent users more weight. Neither is automatically correct: the product decision determines which quantity matters.

For this exercise, assume users are independently sampled from the target population, all have a fixed observation window, and both frozen models receive the same evaluation inputs. Compute one score per model per user and let d_i be new-model score minus baseline score. The point estimate is the mean of these user differences.

This estimates performance on the specified evaluation distribution. It does not establish the causal effect of shipping a model: offline scores may omit changes in user behavior. It also conditions on the two fitted models; uncertainty from training them on different datasets is a separate question.

2. Resample the independent unit

For each replicate, draw 1,000 user indices uniformly with replacement from the observed 1,000 users. Carry each selected user's complete paired evaluation record into that replicate. Compute the same mean difference. Repeat, for example, 10,000 times and inspect the resulting distribution.

A two-sided 95% percentile interval uses the 2.5th and 97.5th percentiles of those replicate statistics. Other interval constructions include basic and bias-corrected/accelerated methods. An implementation's default does not certify that your sampling assumptions or statistic are appropriate. Fix and record the random seed, method, replicate count and quantile convention.

Preserve multiplicity: if user 17 is sampled three times, that user contributes three copies. Deduplicating sampled IDs silently changes the procedure. If downstream software groups by identity, give each selected copy a separate bootstrap-instance identity while retaining its original user ID for provenance.

3. Preserve the pairing

Consider four users with baseline scores [1, 2, 8, 9] and new scores [2, 3, 9, 10]. Every paired difference is 1. Any bootstrap sample of those paired differences has mean 1. Independently resampling each model can pair unrelated users and introduce variability caused by user difficulty rather than the observed model difference.

The degenerate interval in this toy example is not proof that improvement is exactly 1 in the population. Four observations with identical differences contain little information about unobserved heterogeneity. Some interval methods may fail or return undefined bounds on degenerate data. Investigate rather than hiding warnings.

If models were evaluated on different independent users, pairing would be unjustified. For a randomized experiment, preserve its assignment and sampling structure; do not create synthetic before/after pairs merely because two rows have the same position in a file.

4. Show how request resampling fails

Imagine each of 1,000 users has exactly 100 request-level measurements, all identical within that user. Across users, measurements are independent Bernoulli outcomes with probability 0.5. There are 100,000 rows but only 1,000 independent outcomes.

The standard deviation of the overall mean is sqrt(0.25 / 1,000), about 0.01581. Treating all rows as independent gives sqrt(0.25 / 100,000), about 0.001581: ten times smaller. Replicating a user's measurement 100 times has not created 100 independent users. This is an exact variance comparison under the stated hypothetical data-generating process, not a measured interval from the site.

User resampling preserves within-user dependence, but it does not solve every dependency. Household members, shared organizations or common incidents can correlate users. Identify the largest relevant independent sampling unit or use a method suited to the actual dependence structure. If only a few organizations are observed, millions of requests do not make organization-level uncertainty well estimated.

5. Recompute ratio metrics inside each replicate

Suppose user A generates $10 from 100 requests, while user B generates $9 from 10 requests. The pooled revenue per request is $19 / 110 ≈ $0.1727. The mean of user-specific revenue rates is ($0.10 + $0.90) / 2 = $0.50. These answer different questions.

For the pooled ratio, keep each user's revenue and request count together. Resample users, sum selected revenues and selected request counts with multiplicity, then divide the sums. Do not bootstrap user rates and average them unless equal user weighting is the target.

With two draws from this tiny sample, AA gives $0.10, AB and BA each give about $0.1727, and BB gives $0.90. Their probabilities are 1/4, 1/2 and 1/4. The bootstrap mean need not equal the original ratio because a ratio is nonlinear. These four possibilities illustrate the mechanism; two users are not an adequate basis for a reliable production confidence interval.

6. Build a reproducible evaluation job

Freeze an input manifest containing eligibility rules, observation cutoff, labels, model versions and stable unit IDs. Aggregate sufficient statistics per user when the metric allows it, then run a pure statistic function on sampled user records. Save the point estimate, replicate distribution or reproducible seed, interval settings and excluded-data counts.

At 1,000 users and 10,000 replicates, naive resampling touches 10 million user records, versus one billion request rows if all 100 requests are materialized repeatedly. Batch computation to bound memory. This optimization is valid for means and ratios with sufficient aggregates; user-level summaries may not preserve a pooled percentile or ranking statistic.

Keep data filtering and metric definitions identical across replicates. If the target is uncertainty of an entire training-and-selection pipeline, reproduce the relevant fitting and selection steps inside an appropriate resampling design. Bootstrapping only final test scores omits those sources of variation and cannot repair test-set-driven model selection.

7. Know what more replicates cannot fix

Increasing replicate count reduces simulation noise in the bootstrap calculation. It does not create more independent observations, repair missing populations or remove biased labels. Check endpoint stability across additional replicates and seeds, but do not confuse numerical stability with statistical validity.

Rare failures absent from the sample remain absent from ordinary resamples. Extreme quantiles, tiny samples, boundary parameters and heavy-tailed ratios deserve special scrutiny. Compare with analytic calculations in simple cases and simulate datasets with known truth and plausible dependence to evaluate coverage before adopting the procedure.

A nominal 95% confidence interval concerns repeated-sampling coverage under the procedure's assumptions. It is not a claim that 95% of users improve, nor an automatic 95% probability that this particular fixed population effect lies inside the observed interval.

Foundation: explain replacement and sampling units. Senior: derive the tenfold standard-error mistake and ratio example. Staff: design validation when users share organizations and the model was selected after repeated evaluation.

Score 0–2 each for estimand clarity, dependence handling, paired comparisons, ratio computation and limitations. Continue with confidence intervals and multiple testing.

Sources and next steps

The scoring scenarios, counterexamples, calculations and evaluation-job design are original. Source examples have not been reproduced.

Continue your preparation

Choose a connected learning path or browse more ML fundamentals questions. Read our editorial method and attribution policy.