The interview problem

Practice prompt

Explain how two stable populations can produce a variable combined metric.

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 Var(Y)=E[Var(Y|G)]+Var(E[Y|G]). Derive it by writing Y−E[Y] as a within-group residual plus a group-mean offset; the cross term has expectation zero.

2. Trace the design or derivation

Condition on group
  → residual plus mean offset
  → zero cross term
  → variance sum

The decomposition is descriptive, not automatically causal. A group label may be correlated with an unobserved factor. Use it to locate where variation appears, then investigate why, rather than declaring that changing group membership would change outcomes by the observed difference.

3. Calculate the example

Two equally weighted groups have means 2 and 6, each with variance 1. Overall mean is 4; between-group variance is 4 and total variance is 1+4=5.

4. Failure cases and trade-offs

A pooled variance does not identify which group changed. Reweighting groups can alter the overall metric even when each conditional distribution stays fixed.

5. Validation, follow-ups and self-review

Recompute with unequal group weights. Follow-up: how does this help diagnose a latency regression? Self-review: name both terms and the population weights.

Sources and related practice

Technical reference: statproofbook.github.io — Law of total variance.

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 Explain reversals under aggregation; The bias–variance trade-off.

Continue your preparation

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