Random Noodles Loops Expected
Expected number of noodle loops is a medium quant interview question on Expected Value.
This question considers a random pairing process on a fixed set of noodle ends, where you repeatedly connect pairs until every end is matched and the configuration decomposes into disjoint loops. The candidate is asked to reason about the expected number of loops produced by this random matching, treating the whole procedure as a single combinatorial object rather than tracking every possible outcome explicitly. The setting is typical of probability and brainteaser interviews for quantitative research or trading roles, where the focus is on turning an apparently messy random process into something analyzable with clean symmetry arguments.
The solution leans heavily on linearity of expectation and on recognizing how to define indicator variables for structural features of a random matching. It rewards comfort with symmetry in random pairings, viewing each potential loop or each step of the process as contributing some marginal expected value. Interviewers watch for the ability to avoid brute-force enumeration, to set up the right decomposition, to manage a recurrence cleanly, and to justify why the probability of creating a loop at a given stage depends only on the current number of free ends, not on the detailed history.
What it tests
This problem class is governed by the principle of linearity of expectation applied to combinatorial random processes, where each possible structure (here, a loop) can be considered as arising independently with a calculable probability at each step. The key is that the expected number of certain substructures can be decomposed into a sum over the steps or objects, often leading to a telescoping or harmonic-like series. The recurrence emerges because, at each step, the probability of forming a new structure depends only on the current configuration, not on the history, making the process memoryless in expectation. This is why the expected value can be built up incrementally, and why the sum of reciprocals of odd numbers appears: each possible loop formation is an independent event with a probability determined by the current number of free ends. The pattern holds because, in random pairings, each specific pairing event (forming a loop) has a simple, symmetric probability that can be summed over all steps.
Practise this question with written feedback, or hear it in a spoken mock interview.
Get started free