Color Runs in 25 Painted Squares
Expected color runs in 25 squares is a medium quant interview question on Expected Value, reported to have been seen at Akuna Capital, Goldman Sachs and Squarepoint Capital.
MyQuantPartner is not affiliated with, endorsed by, or sponsored by these companies, and all trademarks belong to their respective owners.
This quant interview question is about modeling randomness in a simple one-dimensional configuration and extracting an expected value for a structural property of the outcome. It places you in a clean, discrete probability setting that is easy to state yet surprisingly rich, making it ideal for quant prep where interviewers want to see how you formalize intuition and not just plug formulas.
It trains your ability to work with expectations on combinatorial objects, reason about independent trials, and think in terms of indicators and linearity of expectation. Good candidates identify the right random variables, express events clearly, and control symmetry and bias in the underlying probabilities, all central tools for technical quant interviews.
This matters for quant interviews because it mirrors real tasks in market microstructure and algorithmic trading. You often monitor streams of discrete events, track regime changes, and compute expected counts of transitions or clusters. Doing this confidently, under pressure and without a calculator, signals that you can move from an English description to a robust probabilistic model, a core skill in quantitative finance interviews.
What it tests
Whenever you have a sequence of independent trials, and you are counting the number of 'changes' or 'boundaries' between categories, the expected number of such transitions is governed by the probability that two consecutive elements differ. This is because the process is memoryless: the color of each square depends only on its own probability, and the only way a new segment starts is if the current square differs from the previous one. The expected number of segments is thus the initial segment (always one) plus the expected number of transitions, which is the sum over all adjacent pairs of the probability they differ. This principle holds because the independence of trials ensures that each boundary is an independent opportunity for a change, and linearity of expectation allows us to sum these probabilities directly, regardless of dependencies elsewhere in the sequence.
Practise this question with written feedback, or hear it in a spoken mock interview.
Get started free