The interview problem

Practice prompt

Track a nonlinear hidden state with weighted particles and decide when resampling is needed.

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

Propagate particles through the transition model, multiply weights by observation likelihood and normalize. Estimate state quantities as weighted sums. Use effective sample size as a degeneracy diagnostic and resample with a recorded scheme, recognizing that resampling duplicates particles.

2. Trace the design or derivation

Transition samples
  → likelihood weights
  → normalize
  → diagnose ESS
  → optional resampling

Compute log weights before normalization for numerical stability. Resampling cannot recover a mode absent from every particle; additional diversity or an improved proposal is required. Compare estimated uncertainty against known simulated trajectories before trusting the filter on real data.

3. Calculate the example

Weights [0.7,0.1,0.1,0.1] give ESS=1/(0.49+0.03)≈1.923 out of four particles. Four stored particles therefore do not imply four equally informative hypotheses.

4. Failure cases and trade-offs

Resampling too often reduces diversity; too rarely leaves most computation on negligible weights. A poor proposal can miss the relevant region entirely.

5. Validation, follow-ups and self-review

Test multimodal observations and likelihood underflow. Follow-up: how could a better proposal help? Self-review: distinguish weight degeneracy from missing support.

Sources and related practice

Technical reference: www.stats.ox.ac.uk — Particle weighting, resampling and degeneracy.

Source publication/update: April 2008; revised December 2008. 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 effective sample size under dependence; Distinguish sequence likelihood from the best hidden path.

Continue your preparation

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