Quant interview prep guides

Balls Into Bins Interview Questions

Balls into bins interview prep for labeled assignments, empty bins, collisions, expected counts, and common uniformity mistakes.

Candidates who need an interview-ready version of occupancy reasoning.

Set up balls and bins

In the standard interview setup, each ball independently chooses one of several bins. Clarify whether balls and bins are labeled before doing any counting.

Empty-bin expectation

For a fixed bin, the probability it stays empty after n balls choose among m bins is (1 - 1/m)^n. Multiply by m to get the expected number of empty bins.

Concrete example

If 10 balls independently choose among 5 bins, the expected number of empty bins is 5 x (4/5)^10. This avoids enumerating all occupancy patterns.

Collision probability

No-collision probability is often easier than collision probability. Count assignments where every ball lands in a distinct bin, then take the complement if needed.

Labeled versus unlabeled

Assignments of labeled balls to labeled bins are not the same as unordered occupancy vectors. Mixing these sample spaces is a common source of wrong answers.

Common mistakes

Candidates often assume every final bin-count pattern is equally likely. The process usually makes assignments equally likely, not count vectors.

Practice the pattern

Use the LeetQuidity curriculum and calibration to turn this topic into a focused practice plan.