Puzzles

Reasoning puzzles of the kind interviews ask, each with a worked solution that explains how to get there rather than only what the answer is.

A puzzle in an interview is rarely about the answer. What is being watched is how you start on something you have not seen before: whether you ask what the constraints are, whether you try a smaller version first, and whether you say what you are thinking. Silence followed by a correct answer scores worse than thinking aloud and getting most of the way.

So every puzzle here shows its working, and says which technique it is really about. That last part is the one worth keeping — parity, counting outcomes, balancing a worst case, finding an invariant. The answers you can look up; the techniques are what let you solve the one you were actually asked.

Probability puzzles

Chance, and the places intuition reliably fails at it. Most of these turn on counting the cases correctly, or on noticing that a piece of information you were given has already changed the odds.

Puzzle What it tests Difficulty
The Three Doors Three doors, one car. You pick one, the host opens another. Switch or stay? Noticing that the host’s choice was not free Medium
At Least One Boy A family has two children and at least one is a boy. Are both boys? Listing the cases the condition actually leaves Medium
The Boy Born on a Tuesday One of two children is a boy born on a Tuesday. Probability both are boys? Seeing that an irrelevant-looking detail changes the count Hard
The Shared Birthday How many people must be in a room before two share a birthday, more likely than not? Counting pairs rather than people Medium
Rolling Every Face How many rolls of a fair die, on average, before every face has appeared? Splitting a wait into independent waits Hard
Waiting for a Six On average, how many rolls of a fair die before the first six? Reading an expectation off a self-referring equation Easy
Two Heads in a Row How many flips of a fair coin, on average, before two heads land in a row? Tracking what a partial success is worth Hard
The Three Cards Three cards: one red both sides, one white both sides, one of each. You see red. Counting faces instead of cards Medium
Breaking a Stick Break a stick at two random points. Can the three pieces form a triangle? Turning a condition into an area Hard
A Positive Test for a Rare Disease A 99% accurate test comes back positive. The chance you are ill is one in six. Weighing a test result against how rare the thing is Hard
The Three-Card Swindle One card is red both sides, one black both sides, one mixed. A fair bet is not fair. Counting faces rather than cards Medium
Nobody Gets Their Own Hat Four hats returned at random. What are the odds that nobody gets their own? Counting arrangements that avoid every fixed point Hard
The Higher of Two Dice Roll two dice and keep the larger. What is its average value in the long run? Finding a distribution before an average Medium
At Least One Six in Four Rolls The bet that founded probability theory, and the one that broke it. Turning "at least one" into "not none" Medium
Dice That Beat Each Other in a Circle Four dice, each beating the next two times in three, and the last beating the first. Accepting that "beats" need not be transitive Hard
Ten Heads in a Row One coin in a thousand is two-headed. Yours has just landed heads ten times. Updating a tiny prior on strong evidence Medium
The Game Worth Infinity Double your money on every head. The fair price is infinite. Would you pay £50? Noticing when an expected value stops being useful Hard
Better in Both, Worse Overall Treatment A beats B on small stones and on large ones, and loses overall. Noticing that a pooled average hides its groups Hard
The Warden's Answer The warden names a prisoner who will hang. Does that help the one who asked? Asking whether an answer could have gone another way Medium
Counting Tanks From Serial Numbers Five captured tanks, the highest numbered 60. How many were built? Estimating a total from a sample maximum Hard
Pick Your Triple Second Whatever run of three heads and tails you choose, I can choose a better one. Seeing that "first to appear" is not transitive Hard
Dropping a Needle for Pi Drop a needle on ruled paper. The chance it crosses a line involves pi. Getting a constant out of a random experiment Hard
Your Friends Have More Friends On average, your friends are more popular than you. For almost everybody. Spotting a sample that weights itself Medium
Why the Bus Takes So Long Buses average ten minutes apart. Turn up at random and you wait longer. Realising you are more likely to land in a long gap Medium
Why So Many Numbers Start With One In real-world data the leading digit is a 1 about thirty per cent of the time. Thinking in ratios rather than in gaps Medium

Number puzzles

Digits, divisibility, remainders and sums. No formula to recall - the work is spotting which property of a number the puzzle is really asking about, and that is usually parity, a remainder, or a sum that cannot change.

Puzzle What it tests Difficulty
Adding to a Hundred Add every whole number from 1 to 100, without adding them one at a time. Pairing from both ends instead of adding in order Easy
The Missing Number The numbers 1 to 100 are in a bag with one removed. Find it in one pass. Comparing a total against the total it should have been Easy
Zeros at the End How many zeros does 100 factorial end in? Counting the scarcer of two factors Medium
Three in a Row Why is the product of any three consecutive whole numbers always divisible by six? Arguing from remainders rather than examples Medium
The Last Digit of a Power What is the final digit of 7 raised to the hundredth power? Finding the cycle the last digit repeats in Medium
Adding the Odd Numbers Add the first ten odd numbers. Why is the answer always a perfect square? Seeing a pattern and then explaining it Easy
Reversing the Digits Subtract a two-digit number from its reverse. Why is the answer always a multiple of nine? Writing a number in terms of its digits Easy
The Missing Pound Three guests, a refund, a dishonest porter, and a pound that is not missing. Spotting a sum that adds the wrong things together Medium
Zeros at the End of 100! How many zeros does 100 factorial end in? Count fives, not tens. Counting factors instead of multiplying Medium
Which Numbers Are Runs? Some numbers are a run of consecutive integers. Powers of two never are. Linking a representation to odd divisors Hard
Counting the Ones Write out every number from 1 to 100. How many times do you write the digit 1? Counting a digit by position Medium
Cubes That Add to a Square 1 + 8 + 27 + ... + 1000. The answer is a perfect square, and not by accident. Noticing an identity in a list of totals Medium
The Number That Rotates Multiply 142857 by 2, 3, 4, 5 or 6 and the same digits come back, rotated. Seeing a repeating decimal as a whole number Medium
Everything Falls to 6174 Sort the digits up, sort them down, subtract, repeat. Almost every number lands on 6174. Following a process to its fixed point Medium
How Long Is 2 to the 100th? Not the value - just how many digits it has. Thirty-one. Using a logarithm to measure a number's length Hard
The Last Two Digits of 7 to the 2024th Powers of 7 end in a repeating pattern of four. 2024 lands on the start of it. Finding the cycle length of a remainder Hard
The Number That Equals Its Parts 6 = 1 + 2 + 3. Find the next number that equals the sum of its own divisors. Adding up proper divisors Medium
Numbers Made of Their Own Digits 153 is one cubed plus five cubed plus three cubed. There are only three others. Searching a small space with a rule Medium
Casting Out Nines Add the digits, keep adding, and you have a fingerprint of the number. Checking a calculation without redoing it Medium
The Test for Eleven Add and subtract the digits alternately. If eleven divides that, it divides the number. Using alternating signs to reduce a number Easy
Squaring Anything Ending in Five 35 squared is 1225. The 12 is 3 times 4, and the 25 is always there. Seeing why a mental trick is a factorisation Easy
Four in a Row, Plus One Multiply any four consecutive whole numbers and add one. Always a perfect square. Proving a pattern instead of trusting it Medium
Does 0.999… Equal 1? Not nearly one. Not approaching one. Equal to one, and here are three proofs. Taking a recurring decimal as a completed value Medium
Every Even Number, Two Primes Every even number above two is the sum of two primes. Nobody has proved it. Telling a checked pattern from a proved one Medium
Which Number Has the Most Divisors? Not the largest number, and not the one with the biggest prime factor. Counting divisors from the prime factorisation Medium

Questions people ask

Why do interviews ask puzzles?

Less often than they used to, and rarely to see whether you get the answer. What an interviewer is watching is how you start on something you have not seen before: whether you ask what the constraints are, whether you try a smaller version first, and whether you say what you are thinking. Silence followed by a correct answer scores worse than thinking aloud and getting most of the way.

Is it worth memorising the classic ones?

Only up to a point. The classics are worth knowing because the technique in each one - pigeonhole, invariants, working backwards from the end state, weighing to split a set in three - transfers to puzzles you have not seen. Memorising the answer without the technique leaves you with nothing the moment the numbers change.

What if I cannot solve one?

Read the working, then close it and solve it again from scratch a day later. A puzzle you have read the answer to is not a puzzle you can do.