Lessons
Puzzles
Classic one-off interview puzzles, each with a step-by-step solution. Every one opens in the lesson whose method solves it.
0/26 solved
StatusPuzzleLessonLevel
1. Labelling a dieYou write the numbers 1 to 6 on the faces of a blank cube, one number per face. Two labellings count as the same if you can turn one cube to look exactly like the other. How many different dice can you make?Hard · PermutationsPermutationsHard2. One bubble-sort passThe numbers 1 to 5 are put in a random order. You make one bubble-sort pass: go left to right, swapping each neighbouring pair that’s in the wrong order. What’s the chance the list is sorted after that one pass?Hard · PermutationsPermutationsHard3. Dealt a straightA straight is 5 cards of consecutive ranks, like 5-6-7-8-9 (the ace can be low, A-2-3-4-5, or high, 10-J-Q-K-A). Of the 2,598,960 possible 5-card hands, how many are a straight but not all one suit?Medium · CombinationsCombinationsMedium4. Locks and keys5 partners lock a safe with several locks and share out keys so that any 3 of them together can open every lock, but no 2 of them can. What’s the fewest locks they need?Hard · CombinationsCombinationsHard5. 100 switches100 switches start off. Person 1 flips every switch, person 2 flips every 2nd switch, person 3 every 3rd, and so on up to person 100. How many switches are on at the end?Medium · Inclusion–exclusionInclusion–exclusionMedium6. Evens before oddsYou roll a fair die until every face has come up at least once. What’s the chance that 2, 4 and 6 have all appeared before you see any odd number?Medium · Equally likely outcomesEqually likely outcomesMedium7. Meeting in a knockout128 players are put in a random knockout bracket. Every game knocks one player out, and the better player always wins. You pick two of the players at random. What’s the chance they play each other at some point?Medium · Equally likely outcomesEqually likely outcomesMedium8. The two best in the final128 players are put in a random knockout bracket, and the better player always wins. What’s the chance the two best players meet in the final?Medium · Equally likely outcomesEqually likely outcomesMedium9. Odd sums on a 3 × 3 gridThe numbers 1 to 9 are placed at random in a 3 × 3 grid, one per square. What’s the chance every row and every column adds up to an odd number?Hard · Equally likely outcomesEqually likely outcomesHard10. Rolling until a repeatYou roll a fair die again and again, stopping as soon as a number comes up that you’ve already rolled. On average, how many rolls do you make (counting the last)?Medium · ComplementsComplementsMedium11. The free ice-cream lineAn ice-cream shop gives a free cone to the first person in line whose birthday matches someone ahead of them. Birthdays are random over 365 days. Which place in line gives you the best chance of the free cone?Hard · ComplementsComplementsHard12. The Monty Hall problemA game show has 3 doors: a car behind one, goats behind the other two. You pick a door. The host, who knows where the car is, opens one of the other doors to show a goat, then lets you switch to the last closed door. If you switch, what’s the chance you win the car?Medium · Conditional probabilityConditional probabilityMedium13. The card after the first aceYou shuffle a deck and turn the cards over one at a time until the first ace appears. What’s the chance the very next card is the king of hearts?Hard · Conditional probabilityConditional probabilityHard14. A spinner raceA spinner has 7 equal spots numbered 1 to 7. You spin it again and again. What’s the chance a 5 comes up twice before either a 4 or a 6 comes up even once?Medium · Splitting into casesSplitting into casesMedium15. The lost boarding pass100 passengers board a plane with 100 seats, one at a time. The first has lost their boarding pass and sits in a random seat. Everyone after sits in their own seat if it’s free, and in a random free seat if it isn’t. What’s the chance the last passenger gets their own seat?Hard · Splitting into casesSplitting into casesHard16. The last colour standingA bag holds 3 red, 2 blue and 2 green marbles. You take them out one at a time, at random. What’s the chance that when the last red marble comes out, at least one blue and at least one green are still in the bag?Hard · Splitting into casesSplitting into casesHard17. Bertrand’s boxThere are three boxes. One holds two gold coins, one holds two silver coins, and one holds a gold coin and a silver coin. You pick a box at random and take out one coin without looking: it’s gold. What’s the chance the other coin in that box is gold too?Medium · Bayes’ ruleBayes’ ruleMedium18. The gambler and the friendA smaller version of the roulette gambler: a wheel has 6 equal sections, and a $1 bet on one section pays 5 to 1. You bet $1 on the same section for 6 spins. What’s the chance you end up behind?Easy · Binomial distributionBinomial distributionEasy19. Two coin waitsAlice and Bob each flip a fair coin until they get heads, counting their flips. You’re told Bob needed more flips than Alice. On average, how many flips did Alice need?Hard · Geometric distributionGeometric distributionHard20. An ant on a tetrahedronAn ant stands on one corner of a tetrahedron (4 corners, each joined to the other 3). Each step it walks to one of the other 3 corners at random. On average, how many steps until it has visited every corner and is back where it started?Medium · Collecting every typeCollecting every typeMedium21. The Pólya urnYou take penalty kicks. You score the first and miss the second. After that, your chance of scoring each kick equals the share of kicks you’ve scored so far (so the third kick goes in with chance 1/2). What’s the chance you score exactly 6 of the next 10?Hard · Random walksRandom walksHard22. A running total past a targetYou roll a fair 4-sided die and keep a running total, stopping as soon as the total is 10 or more. What’s the final total on average?Medium · Optimal stoppingOptimal stoppingMedium23. The broken stick triangleYou break a stick at two random points, chosen independently. What’s the chance the three pieces can form a triangle?Medium · Probability as areaProbability as areaMedium24. The shortest pieceYou break a 1 m stick at two random points. What’s the chance the shortest of the three pieces is 20 cm or less?Medium · Probability as areaProbability as areaMedium25. An acute triangle on a circleYou pick three random points on a circle and join them into a triangle. What’s the chance the triangle is acute (every angle under 90°)?Hard · Probability as areaProbability as areaHard26. The highest roll before a 4You roll a fair die until it shows a 4, then stop. What’s the highest number you rolled, on average (counting the final 4)?Medium · Highest and lowest valuesHighest and lowest valuesMedium