The interview problem

Practice prompt

Estimate E[X] using a correlated variable Y whose expectation is known.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Use Z=X−c(Y−E[Y]); its expectation remains E[X] for fixed c. Variance is Var(X)+c²Var(Y)−2cCov(X,Y), minimized at c=Cov(X,Y)/Var(Y).

2. Trace the design or derivation

Paired samples
  → center known control
  → subtract weighted control
  → average

Compare variance per unit compute, not only per observation. A highly correlated control that doubles runtime may still be worthwhile, but the decision needs measured cost. Keep random seeds coupled appropriately so the intended correlation actually exists.

3. Calculate the example

If Var(X)=4, Var(Y)=1 and Cov(X,Y)=1.5, c=1.5 and variance becomes 4−2.25=1.75. This is a 56.25% variance reduction per paired sample.

4. Failure cases and trade-offs

An incorrect known mean creates bias. Estimating c on the same small sample can complicate finite-sample properties; independent pilot fitting or cross-fitting makes the contract clearer.

5. Validation, follow-ups and self-review

Check zero covariance and sign reversal. Follow-up: when does the control cost more than it saves? Self-review: derive the minimizer and identify the known quantity.

Sources and related practice

Technical reference: artowen.su.domains — Control variates and variance reduction; numerical example is original.

Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Estimate expectations with Monte Carlo; Diagnose high-variance importance-weighted estimates.

Continue your preparation

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