5-Digit Numbers with Unique Pairwise Sums

Five digit numbers with unique digit sums is a medium quant interview question on Brain Teasers, reported to have been seen at Optiver.

Difficulty Medium Topic Brain Teasers Reported at Optiver

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

This brain teaser is about five-digit numbers whose digits interact under a strict combinatorial constraint: every sum formed by choosing two different digits must be different from every other such sum. It sits at the intersection of discrete math and number structure, forcing you to think about how digit choices propagate through all induced pairwise relationships. It is often used because it looks simple but hides a rich combinatorial core.

Solving it trains combinatorial reasoning, pattern spotting, and systematic search under constraints, all crucial in quant prep. You learn to balance local decisions on single digits with global requirements on the whole set of pairwise sums. It also develops the ability to reason about extremal configurations while keeping track of many interacting conditions.

This matters in quant interviews because trading and risk models often involve intertwined constraints, not isolated calculations. Interviewers want to see whether you can manage complex combinatorial structures, reason about uniqueness conditions, and explore the space of possibilities efficiently without brute force. It's a direct test of how you think under pressure in a quant interview setting, not just what formulas you know.

What it tests

This problem class is governed by the principle of pairwise sum uniqueness among a set of digits. For any $n$-digit number, the set of all possible sums of two distinct digits must be distinct, which is a combinatorial constraint on the choice of digits. The underlying structure is that, for $n$ digits, there are $n(n-1)/2$ pairs, each requiring a unique sum. This forces the digits to be spaced apart in such a way that no two pairs overlap in their sum, and the constraint becomes tighter as $n$ increases. The reason this pattern holds is that repeated digits or closely spaced digits quickly lead to duplicate sums, so only certain configurations—often involving non-consecutive, well-separated digits—are possible. The problem is a specific instance of a more general combinatorial design constraint, where the set system (here, pairs of digits) must avoid collisions in a derived property (the sum).

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

Get started free