The interview problem

Practice prompt

A count series has mean 4 and variance 12. Explain why a Poisson fit is restrictive and propose an alternative.

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

Under the negative-binomial mean/shape parameterization, variance is μ+μ²/r. This can arise from a Poisson rate mixed over a Gamma distribution. Fit exposure and covariates before attributing every extra variation to irreducible dispersion.

2. Trace the design or derivation

Empirical count moments
  → dispersion model
  → parameter mapping
  → predictive checks

As r tends to infinity at fixed μ, the variance approaches μ and the model approaches Poisson. A small r allows a heavier count tail, but it should not excuse unmodeled seasonality that a simple calendar feature could explain.

3. Calculate the example

Set 12=4+16/r, giving r=2. In the failures-before-r-successes convention, p=r/(r+μ)=1/3. Libraries differ in naming, so write the mapping explicitly.

4. Failure cases and trade-offs

Extra zeros, time dependence or missing exposure can require more than one dispersion parameter. Matching two moments does not validate tail probabilities.

5. Validation, follow-ups and self-review

Inspect residuals and held-out count calibration. Follow-up: what happens as r grows? Self-review: distinguish mean, shape and probability parameterizations.

Sources and related practice

Technical reference: docs.scipy.org — Negative-binomial mean and variance parameterization.

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 Model counts with Poisson regression; Update a Poisson rate with a Gamma prior.

Continue your preparation

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