The interview problem

Practice prompt

A product team offered optional onboarding coaching to some new customers. Customers who received it completed more tasks during their first week. Estimate the average effect of offering coaching using observational records. Explain an estimator that combines an assignment model and outcome models, work through four records, and identify when its answer would be unreliable.

Original fundamentals practice, not a reported company interview. The product, records and numerical examples are invented. Interview date: not applicable. Sources retrieved September 29, 2026.

1. Define the effect before choosing a model

Let A be whether coaching was offered, Y the first-week completed-task count, and X information measured before the offer. Target the average treatment effect, E[Y(1) − Y(0)], for the population of eligible new customers. An offer is different from attendance: selecting only customers who accepted changes the question and can introduce selection bias.

For this exercise assume a well-defined offer, no interference between customers, complete outcome observation and independent customer records. Assume that X contains sufficient pre-offer confounders and that both offer states are possible at each relevant X. These are identification assumptions, not benefits delivered by a model. If sales staff used an unrecorded urgency assessment to decide whom to coach, the causal interpretation needs more evidence.

Ask how eligibility, assignment and observation were recorded. Exclude post-offer variables such as coaching attendance from the baseline adjustment set. Define the first-week window identically for both groups. A randomized offer would generally give a more credible comparison if practical.

2. Combine predictions with weighted residuals

Write e(X) for the probability of an offer and m₁(X), m₀(X) for expected outcomes with and without an offer. Hats below mean fitted predictions for that customer's covariates. The augmented inverse probability weighted estimate averages the following scores:

score_i = m̂₁(X_i) − m̂₀(X_i)
        + A_i / ê(X_i) × [Y_i − m̂₁(X_i)]
        − (1 − A_i) / [1 − ê(X_i)] × [Y_i − m̂₀(X_i)]
ATE estimate = sum(score_i) / n

Start with a predicted contrast for everyone. Add a residual correction for the outcome actually observed. A control customer's correction is subtracted because it adjusts the no-offer mean. Neither correction reveals an individual's missing counterfactual, and an individual score is not an estimated personal treatment effect.

3. Calculate a small example

Suppose the following nuisance predictions were fixed before evaluating these four records. They are illustrative predictions, not models fitted on four customers.

RecordAYêm̂₁m̂₀Score
1180.5646
2030.5543
3150.25426
4040.75756
Record 1: (6 − 4) + (8 − 6)/0.5 = 6
Record 2: (5 − 4) − (3 − 4)/0.5 = 3
Record 3: (4 − 2) + (5 − 4)/0.25 = 6
Record 4: (7 − 5) − (4 − 5)/0.25 = 6
AIPW estimate = (6 + 3 + 6 + 6)/4 = 5.25 tasks
Outcome-only estimate = (2 + 1 + 2 + 2)/4 = 1.75 tasks
Unadjusted observed difference = (8 + 5)/2 − (3 + 4)/2 = 3 tasks

The three answers differ because they use different adjustments. These four rows do not establish that 5.25 is closest to the truth. A useful implementation check is the sign on record 2: observing a control outcome below its prediction lowers the estimated no-offer mean, so it increases the estimated effect.

4. Explain exactly what “doubly robust” means

Here is an algebra check for the offered-outcome mean. At a fixed X, call the true assignment probability p and true offered-outcome mean μ. Consider a fixed candidate probability q strictly between zero and one, and a candidate outcome mean g. Taking expectation over new observations gives:

E[g + A/q × (Y − g) | X]
  = g + p/q × (μ − g)
  = μ + (q − p)/q × (g − μ)

If q = p, the final term is zero even with an incorrect g. If g = μ, it is zero even with an incorrect q. For the control mean the analogous error is (p − q)/(1 − q) times (g₀ − μ₀). Therefore the contrast is correct when the propensity is correct, or when both arm-specific outcome means are correct. Getting just one outcome arm right is insufficient in general.

As an original numerical check, let p = 0.25 and μ = 8. A correct q = 0.25 with g = 6 gives 6 + (0.25/0.25) × 2 = 8. A correct g = 8 with q = 0.5 also gives 8. With both wrong, q = 0.5 and g = 6 give 7, with bias −1. Two plausible-looking models do not guarantee correctness.

This is a fixed-function expectation identity. With estimated nuisance functions, consistency requires appropriate convergence and regularity conditions. It is not a promise of exact finite-sample unbiasedness, and it leaves the causal identification assumptions intact.

5. Build an auditable estimation pipeline

eligible cohort + pre-offer features + complete outcome window
  → customer-level folds
  → train nuisance models outside each held-out fold
  → held-out propensity and both outcome predictions
  → overlap checks + row-level scores
  → population estimate + uncertainty + sensitivity report

Use cross-fitting: train on the other folds and score the held-out fold, then aggregate held-out scores across all customers. Keep feature selection, preprocessing and tuning inside the training side. Store customer IDs, fold assignments, feature cutoff times and model versions so each score can be reproduced. If repeated records belong to a customer, keep that customer together; the uncertainty method must also reflect dependence.

For example, five folds over 100,000 independent customers produce 20,000 held-out scores per fold. One propensity model plus two separate outcome models per fold requires 15 final nuisance fits, before any tuning or repeated splits. Each arm-specific outcome model trains only on the matching treatment subset of the other 80,000 customers.

Compare the result with outcome-only and inverse-weighted estimates as diagnostics. Agreement does not prove validity; disagreement should trigger investigation of support, model errors and influential observations rather than selection of whichever result best supports the launch.

6. Investigate overlap and influential records

If an offered customer's predicted propensity is 0.01 and its residual is 3 tasks, the positive correction is 300. In a sample of 1,000, that correction alone contributes 0.3 tasks to the average. A few such records can dominate the result.

Inspect propensity distributions by treatment arm and important customer segments, along with weight concentration and extreme scores. High assignment-classification accuracy can indicate that the groups are easy to separate, which is not reassuring for estimating counterfactual outcomes.

Clipping 0.01 to 0.05 would reduce that correction to 60. It stabilizes this number but modifies the estimator and can introduce bias. Removing low-overlap customers changes the target population; report who was removed and redefine the estimand explicitly. Neither operation creates missing evidence about a segment that never receives one of the treatments.

7. Separate consistency from a valid interval

Do not compute a confident interval from the four-row teaching example. A large-sample influence-score interval needs conditions beyond “one model is correct.” With cross-fitted machine learning, standard inference typically requires nuisance errors small enough that their product is negligible relative to n−1/2, together with overlap and moment conditions. Cross-fitting alone does not establish these conditions.

Under a justified independent-observation influence-score approximation, the standard error is approximately the standard deviation of the scores divided by √n. If that standard deviation were 12 tasks across 10,000 eligible independent customers, the illustrative standard error would be 0.12 tasks and a normal 95% half-width about 0.235 tasks. These assumed numbers illustrate arithmetic, not an interval supported by our toy data.

Dependence, heavy tails, nuisance misspecification or an adaptive population filter can invalidate a naive interval. Use an inference procedure appropriate to the design, and report sensitivity to defensible model and overlap choices. Uncertainty about unmeasured confounding is not captured by an ordinary sampling confidence interval.

Failure analysis, follow-ups and self-review

  • Missing confounder: a staff member's unrecorded judgement affects both assignment and outcomes. Better prediction scores do not establish identification.
  • Leakage: post-offer attendance or future activity enters X. Reconstruct features at the decision time.
  • Incomplete outcomes: customers who churn lose task records. The complete-outcome assumption fails; dropping them can change the target.
  • Wrong estimand: the team wants the effect on actual attendees, but the analysis estimates an offer effect for all eligible customers.
  • Unstable weights: a rare assignment drives the result. Show its contribution and discuss support before rollout.

Follow-ups: How does known randomized assignment simplify the estimator? What changes for an effect among offered customers rather than everyone eligible? How would clustered assignment, missing outcomes or customer spillovers alter the analysis?

A strong answer defines the population and treatment, computes the residual corrections with the right signs, and proves both robustness cases. An excellent answer separates identification, nuisance consistency and inference; checks overlap; and states what evidence would change the decision. “One of my models must be right” is not a defensible assumption.

Sources and attribution

All retrieved September 29, 2026. Exact publication dates for the living documentation were not established. The customer scenario, four-record table, numerical bias check, fit budget and diagnostic examples are original. No recent-interview or company attribution is claimed. Continue with prediction versus causal effects and data leakage.

Continue your preparation

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