The interview problem

Practice prompt

Estimate an event rate from counts and exposure while keeping uncertainty explicit.

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 λ~Gamma(α,β) with β as the Gamma rate parameter (units of exposure), and count k over exposure t. Multiplying likelihood λ^k exp(−λt) by the prior gives Gamma(α+k,β+t). Posterior mean is (α+k)/(β+t).

2. Trace the design or derivation

Prior kernel × count likelihood
  → collect powers
  → posterior parameters

A point estimate is not a predictive interval. Future counts include both Poisson variability conditional on λ and uncertainty about λ. For prediction, integrate over the posterior rather than plugging its mean into a Poisson distribution and calling the interval fully Bayesian.

3. Calculate the example

With α=2, β=1 hour, k=8 events and t=3 hours, posterior mean is 10/4=2.5 events/hour. The observed rate alone is 8/3≈2.67.

4. Failure cases and trade-offs

Confusing rate with scale reverses the parameterization. Bursty or dependent events violate a simple homogeneous Poisson model. A prior must use compatible exposure units.

5. Validation, follow-ups and self-review

Check zero events and increasing exposure. Follow-up: derive the predictive count distribution. Self-review: show the likelihood, units and prior contribution.

Sources and related practice

Technical reference: docs.scipy.org — Gamma parameterization; conjugate update is independently derived.

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 conversion probability with a beta prior.

Continue your preparation

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