Cube ends with 11 proof

Probability cube ends with 11 is a medium quant interview question on Combinatorics.

Difficulty Medium Topic Combinatorics

This question looks at the distribution of last digits of integer powers, framed as a probability problem over a large but finite range. The setup is a single integer chosen uniformly at random from a long consecutive interval, and the candidate is asked for the likelihood that its cube ends with a particular pair of digits. It is a typical number-theoretic combinatorics question that appears in quantitative trading and research interviews, where understanding of modular structure and discrete distributions is more important than heavy calculation.

To answer it efficiently, a candidate must recognize that only a small residue class calculation matters, rather than the enormous original range. The core tools are modular arithmetic, periodicity of polynomial maps modulo powers of 10, and counting preimages under such a map. Interviewers look for the ability to reduce a huge-looking problem to a tiny finite search space, to argue carefully about uniformity of residues, and to reason cleanly about congruences without brute-force enumeration or handwaving.

What it tests

Whenever a problem asks about the last $k$ digits of a function of an integer (such as $x^3$), the key insight is that these digits depend only on the residue of the integer modulo $10^k$. This is because any higher powers of ten in the expansion contribute only to more significant digits and do not affect the last $k$ digits. Thus, the problem reduces to analyzing the function as a map from residues modulo $10^k$ to residues modulo $10^k$. The structure of modular arithmetic ensures that, for polynomial functions, the behavior is determined entirely by these residues, and the uniform distribution of the original integer means each residue is equally likely. This allows us to count solutions within a small, finite set, rather than the entire original range.

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

Get started free