Avg Mixed-Gender Adjacent Pairs in Line

Expected adjacent boy girl pairs in line is a medium quant interview question on Combinatorics, reported to have been seen at WorldQuant.

Difficulty Medium Topic Combinatorics Reported at WorldQuant

MyQuantPartner is not affiliated with, endorsed by, or sponsored by these companies, and all trademarks belong to their respective owners.

This combinatorics question is about random permutations of mixed groups and the average amount of "boundary interactions" between categories. It belongs to the family of quant interview problems where you study local patterns inside a global random arrangement, a classic theme in quant prep and probability-heavy interviews.

It trains your understanding of expectation in discrete settings, especially how to handle local events inside a larger structure. You practice modeling random configurations, identifying relevant random variables, and translating an intuitive description of a pattern into a formal probabilistic object whose expectation you can compute cleanly.

This matters for quant interviews because trading desks and research teams care about how you think about structure and randomness, not just formulas. Being able to analyze expected counts of local features is directly relevant to modeling order flow, regime switches, and path properties, and is a recurring topic in rigorous quant prep.

What it tests

The core idea is that the expected number of certain local patterns (like adjacent boy-girl pairs) in a random arrangement can be computed by linearity of expectation. Instead of counting all global arrangements, you focus on each possible position where the pattern could occur, compute the probability it does, and sum over all such positions. This works because the expected value of a sum is the sum of the expected values, regardless of dependencies. The symmetry and uniform randomness ensure that each position is equally likely to host any gender combination, so the problem reduces to multiplying the number of opportunities by the probability for one. This approach generalizes to any problem where you seek the expected count of local features in a random sequence or arrangement.

Practise this question with written feedback, or hear it in a spoken mock interview.

Get started free