Counting Unique Sequences of Colored Balls
Arranging Red Blue Green Balls in Line is an easy quant interview question on Combinatorics, reported to have been seen at IMC.
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 counting how many different linear orderings are possible when several groups of items are repeated and indistinguishable within each color. It sits at the heart of discrete probability, arrangements, and basic counting rules, all of which are standard fare in quant prep and quant interviews. Although the setup feels simple, it encodes an important general pattern that appears in larger and more abstract problems.
It trains your understanding of permutations with repetition and your ability to map a verbal description of repeated objects to a clean combinatorial structure. You practice identifying what truly matters for the count, separating labels that change the outcome from those that do not. This sharpens your skill at formalizing intuition into exact counts.
This matters in quant interviews because many market-making and trading problems reduce to counting distinct states, paths, or allocations where certain elements are effectively identical. Being fluent with this kind of multiset reasoning helps you quickly estimate configuration spaces, normalize probabilities, and sanity-check combinatorial arguments under time pressure. It also signals that you have mastered foundational tools on which more advanced quant prep topics build.
What it tests
When arranging objects where some are indistinguishable from each other, the core principle is to count the total number of orderings as if all objects were unique, then divide by the number of ways to permute each set of indistinguishable objects. This is because swapping indistinguishable objects does not create a new arrangement, so each unique arrangement is counted multiple times in the initial total. The formula for the number of unique arrangements of a multiset with counts $n_1, n_2, \ldots, n_k$ (where $n_1 + n_2 + \ldots + n_k = N$) is $\frac{N!}{n_1! n_2! \cdots n_k!}$. This adjustment ensures each unique arrangement is counted exactly once, regardless of the internal order of indistinguishable items. The reason this works is that for each arrangement, the positions of indistinguishable items can be permuted among themselves without changing the overall arrangement, and dividing by their factorials removes this redundancy.
Practise this question with written feedback, or hear it in a spoken mock interview.
Get started free