Categories

## Speak Both Languages

In a certain classroom, 75% of the students can speak English, 55% of the students can speak French, and 10% speak neither language.

What percentage of the students speak both languages?

Categories

## Color of the Last Ball

There is a bag with 20 blue balls and 13 red balls. Randomly remove 2 balls from the bag:

• If they are the same color, replace them with a blue ball
• If they are different colors, replace them with a red ball

Repeat this process until there is just 1 ball remaining. What is the color of the last ball?

Categories

## Same Birthday in Line

There is a long line of people waiting to see a new movie. They announce that the first person to have the same birthday as someone standing before them in the line gets to meet one of the actors in the movie.

What place in line would maximize your chances of winning? Assume birthdays are uniformly distributed through the year.

Categories

## Prison Keys Strategy

A prison warden was feeling capricious and played a game with the prison keys:

1. Each prisoner is handed a key to another prisoner’s cell.
2. Each prisoner will know which other prisoner was initially given the key to their cell (but does not know whose key they were handed).
3. Each day, when all prisoners are out of their cells and no one is watching, each prisoner is allowed to place keys in another prisoner’s cell.
4. Each night, each prisoner can collect any keys placed in their cell.
5. The prisoners can summon the warden when they’re sure everyone has their own key – but if they are wrong, they’re immediately executed.
6. The prisoners can discuss a strategy beforehand but cannot communicate in any way after keys are handed out.

What is the fewest number of days it would take for the prisoners to be sure everyone has their key? What was the strategy to achieve this?

Categories

## Sharing Game Theory Puzzle

In this sharing game theory puzzle, 3 friends take turns taking from a jar of 1000 candies to share. For example, the 1st friend could take 500 candies, then the 2nd friend could take 400, and the 3rd friend would take the remaining 100.

No one wants to be seen as greedy, but no one wants to end up with the fewest candies either. As such, their goals are (in order of preference):

1. Not end up with the most candies, nor the fewest candies
2. End up with as many candies as possible

All of them are logical, rational, know each other’s goals, but cannot communicate before or during sharing. How many candies should each friend end up with?

Categories

## How Many Friday the 13th in a Year

Some consider Friday the 13th (any Friday that falls on the 13th day of a month) unlucky.

In a calendar year, how many Friday the 13th can occur? Find both the minimum and maximum.

Categories

## Russian Roulette Riddle

In the morbid game of Russian Roulette, a partially loaded revolver with a six-chamber cylinder is randomly spun, pointed at one of the players, and fired. If the revolver landed on an empty chamber, the lucky player is safe, and the process is repeated with the next player. The obvious objective of the game is to not get shot.

You find yourself stuck in a game of Russian Roulette. A freshly loaded revolver is aimed at the first player, and it turns out to be an empty chamber. Your turn is next, and you are given the choice to either:

• Spin the cylinder before pulling the trigger (i.e., you get a random new chamber)
• Or just pull the trigger (i.e., let the revolver fire whatever is in the next chamber)

Which choice should you pick if the revolver was originally:

1. Loaded with one bullet?
2. Loaded with bullets in two random chambers?
3. Loaded with bullets in two consecutive chambers?

Assume the revolver cannot misfire, and that spinning the cylinder lands on all chambers with equal probability.

Some variation of this Russian Roulette riddle was once asked in interviews at Jane Street, Susquehanna International Group (SIG), Facebook (now Meta), UBS, Capital One, and more.

Categories

## The Impossible Puzzle

This puzzle was coined the “Impossible Puzzle” by Martin Gardner, a famous math and science writer that liked to create and write about math games and puzzles. The puzzle is named as such because it appears to provide insufficient information to solve, but it is in fact solvable! Read on for the puzzle and the (very difficult) solution.

There are two distinct whole numbers greater than 1, we can call them x and y (where y > x). We know the sum of x and y is no more than 100.

Sam and Prada are perfect logicians. Sam (“sum”) is told x + y and Prada (“product”) is told x * y, and both of them know all the information provided so far.

Sam and Prada have this conversation in which they truthfully deduce the numbers:

1. Sam: I know Prada does not know x and y.
2. Prada: Well now I know x and y.
3. Sam: Ah, now I also know x and y.

Can you figure out x and y using this information?

Categories

## Reroll the Die

Suppose there is a game in which you roll a fair, 6-sided die and win dollars equal to the outcome of the roll. How much would you expect to win on average?

Suppose, if you don’t like the outcome of the roll, you can reroll the die once, and win dollars equal to the outcome of the 2nd roll (once you choose to reroll, you can no longer go back to the 1st roll). How much would you expect to win on average?

Suppose, if you don’t like the outcome of the 2nd roll, you can reroll the die once more, and win dollars equal to the outcome of the 3rd roll (once you choose to reroll, you can no longer go back to previous rolls). How much would you expect to win on average?

This was an actual brain teaser question once asked at Jane Street for an interview for an intern role.

Categories

## 7 Quant Interview Questions and Answers

Quant interview question often contain brain teasers involving mathematics, statistics, and logic. The goal of these questions is to assess your quantitative and reasoning abilities, which can be highly relevant to working as a quant analyst, trader, or developer. Here are 7 quant interview questions of varying difficulties – how many can you solve?

## 1. Trailing Zeros (easy)

How many trailing zeros does 1000! have?

##### Solution to #1

249 trailing zeros

A trailing zero is added whenever a number is multiplied by 10. To figure out how many factors of 10 there are, just figure out how many factors of 2 and 5 there are (whichever is fewer).

It’s easy to see that a factorial contains many more factors of 2 than factors of 5, so we just need to figure out how many factors of 5 there are.

1 out of every 5 numbers in the factorial is a factor of 5. However, factors of 25 contains two factors of 5, so they need to be counted twice, and so on for other powers of 5.

So there are:

• 1000 / 5 = 200 factors of 5
• 1000 / 25 = 40 factors of 25
• 1000 / 125 = 8 factors of 125
• 1000 / 625 = 1.6 factors of 625 (which rounds down to just 1 factor, 625 itself)

200 + 40 + 8 + 1 = 249

## 2. Sum of 4’s and 5’s (medium)

How many numbers from 1 to 1000 (inclusive) can be written as the sum of some number of 4’s and/or 5’s? For example, 4 + 4 + 5 + 5 + 5 = 23.

##### Solution to #2

994

A good way to solve this:

• Recognize that all multiples of 5 are possible.
• All numbers that are 1 less than a multiple of 5 are possible, by switching out one of the 5’s for a 4.
• For example, 30 = 5 + 5 + 5 + 5 + 5 + 5, so 29 = 4 + 5 + 5 + 5 + 5 + 5.
• By that logic, all numbers between multiples of 5 should be possible, by switching out up to four of the 5’s for 4’s.
• However, this does not work if there are not enough 5’s to switch out for 4’s – which is only true if there were fewer than four 5’s in the sum. So now we know all numbers 15 or greater can be written as the sum of 4’s and 5’s.
• If we just inspect the numbers from 1 to 14, we see that 6 of them cannot be written as the sum of 4’s and 5’s: 1, 2, 3, 6, 7, and 11. Hence 994 of the numbers from 1 to 1000 can be written as the sum of 4’s and 5’s.
Categories

## I Like the Numbers 4 and 5

I like the numbers 4 and 5. I like to add 4’s and 5’s together to make other numbers, such as 4 + 4 + 5 + 5 + 5 = 23. How many numbers from 1 to 1000 can be written as the sum of 4’s and 5’s?

Categories

## Lions and Sheep

On a magical island, there are 100 lions and 1 sheep, all of which can live by eating the plentiful grass on the island. Any lion that eats the sheep will magically turn into a sheep afterward, such that there will always be a sheep on the island.

Every lion would like to eat a sheep, but would much rather prefer to not be eaten (they wouldn’t mind turning into a sheep if they wouldn’t be eaten).

If all the lions act rationally and know all the other lions act rationally, how many lions will remain on the island in the end?

Categories

## 7 Actual Brain Teaser Interview Questions and Answers

Brain teaser interview questions were quite common in tech, finance, and consulting interviews for a period of time. Here are 7 brain teaser interview questions and answers encountered in actual interviews, including engineering interviews at Apple and Microsoft – how many can you solve?

If you want to learn more about brain teaser interviews, check out our guide to brain teaser interview questions.

## 1. Incorrectly Labeled Boxes (easy)

Asked in a software quality assurance engineer interview at Apple.

There are three boxes: one with only apples, one with only oranges, and one with both apples and oranges. All three boxes are incorrectly labeled (e.g., the “apples” label is on either the “apples+oranges” box or the “oranges” box). Is there a way to figure out the correct labels for all three boxes if you are only allowed to see one fruit from one of the boxes?

##### Solution to #1

If you see one fruit from the box labeled “apples+oranges”, then you know for sure that box contains only that fruit, because it cannot be the “apples+oranges” box as all boxes are labeled incorrectly.

Let’s say you saw an apple from the box labeled “apples+oranges”. That box must be the “apples” box. Then the box labeled “oranges” must contain apples and oranges, because it cannot be the “oranges” box (all boxes are labeled incorrectly) and the “apples” box has already been found. Then the remaining box labeled “apples” must be the “oranges” box.

## 2. Water Jug Riddle (easy)

Asked in a software engineer interview at Infosys.

You have a 3-litre jug and a 5-litre jug, and as much water as you need. How do you measure out exactly 4 litres using only these two jugs?

##### Solution to #2

There are multiple possible solutions, but here is one with only a few steps:

1. Fill up the 5-litre jug, and use it to fill up the 3-litre jug. The 5-litre jug now has exactly 2 litres left.
2. Empty out the 3-litre jug
3. Pour the remaining 2 litres in the 5-litre jug into the 3-litre jug.
4. Fill up the 5-litre jug again, and use it to fill up the remaining capacity of the 3-litre jug – the 5-litre jug now has exactly 4 litres in it!

Categories

## Throwing Rocks Off a Boat

A man is throwing rocks off a boat floating in the middle of a lake. The rocks sink quickly to the bottom of the lake.

Does the water level in the lake rise, fall, or stay the same after the rocks are thrown off the boat and sink to the bottom of the lake?

This question was asked in an actual mechanical engineering interview.

Preparing for a brain teaser interview? Check out our ultimate guide to brain teaser interviews.

#### Hint

Consider Archimedes’ principle and how the rocks affect the water level while they are on the boat vs. how the rocks affect the water level when they are in the lake.

Categories

## Card Flipping Endgame

There are n playing cards lined up face-down in a row. Every turn, a pair of adjacent cards with the left card face-down is randomly selected (i.e., a pair of cards has no chance of being selected if the left card is face-up, otherwise all pairs are equally likely to be selected). Both cards are then flipped over (face-down to face-up or face-up to face-down).

Prove that after enough turns, it will eventually be impossible to select a pair of cards with the left card face-down.

When you reach this card flipping endgame, will the rightmost card be face-up or face-down?

Categories

## Number Deduction

A teacher gives three clever students in her class a challenge: she writes down 3 different numbers on 3 index cards, and has each student hold up one of the cards to their forehead such that they can’t see their own card but everyone else can.

She tells them each card has a different number, and that two of the numbers add up to the third number, and asks them to figure out their number without sharing the numbers they see.

Ava sees Sid has 40 on his forehead and Vlad has 60 on his forehead.

Ava says “I don’t know my number.”

Vlad says “I don’t know my number.”

Before Sid can say anything, Ava realizes she is now able to figure our her number! What is Ava’s number?

Categories

## Battery Test Puzzle

You have four good/new batteries and four bad/used batteries but don’t know which are which. You have a flashlight that uses two batteries, which will only work if both batteries are good – if it doesn’t work, you won’t know if both batteries are bad or just one.

How many pairs of batteries do you need to test to guarantee you find a good pair?

Categories

## Fake Coins Proof

You are a rare coins expert and have determined there are 7 fake coins out of 14 gold coins. Now you need to prove to the judge which ones are fake.

It is known that that real coins all weigh the same, fake coins all weigh the same, and fake coins weigh less than real ones (but are otherwise identical).

Using a traditional double-pan balance scale just 3 times, can you prove exactly which of the 14 coins are fake?

Categories

## First to 100

You and a friend play “first to 100”, a game in which you start with 0, and you each take turns adding an integer between 1 and 10 to the sum. Whoever makes the sum reach 100 is the winner.

Is there a winning strategy? If so, what is it?

Categories

## 3 Digit Code

You have six guesses to figure out a 3 digit code. After each guess, you will be told exactly how many digits are correct but in the wrong place and how many digits are correct and in the right place. You have made these five guesses already:

• 865: exactly one digit in the right place
• 964: exactly one correct digit but in the wrong place
• 983: no correct digits
• 548: exactly two correct digits but in the wrong places
• 812: exactly one correct digit but in the wrong place

What is the correct 3 digit code?

Categories

## Tennis in 2 or 3 sets

In a best of 3 tennis match, the player that first wins 2 sets wins the match. For a 3-set tennis match, would you bet on it finishing in 2 or 3 sets?

This question was asked in an actual D. E. Shaw quant trading interview.

Preparing for a brain teaser interview? Check out our ultimate guide to brain teaser interviews.

Categories

## Guess the Number

Jake has a 4-digit number in mind and asks Raj to guess the number. Raj can have 7 guesses, and Jake will give him some hints after 6 guesses.

Raj makes these 6 guesses:

• 6 3 5 8
• 9 3 0 6
• 4 8 8 2
• 6 7 2 8
• 1 1 9 1
• 5 6 2 7

These were all wrong, but Jake says every guess had exactly one (and only one) correct digit in the correct position. Additionally, all the digits are different.

What should Raj’s 7th guess be?

Categories

## Ants on a Stick

Six ants are walking at 1cm/second on a very narrow stick 100cm long:

• Ant 1: starts at 0, facing right
• Ant 2: starts at 20, facing right
• Ant 3: starts at 30, facing left
• Ant 4: starts at 40, facing right
• Ant 5: starts at 60, facing right
• Ant 6: starts at 80, facing left

When two ants run into each other, they immediately turn around and walk in the other direction.

How long does it take before the last ant walks off the stick?

Categories

## Trailing Zeros

How many trailing zeros does 1000! have?

“!” is the factorial symbol. For example, 12! = 12 x 11 x 10 x … x 2 x 1 = 479001600, which has 2 trailing zeros (zeros at the end of the number).

Categories

## Confusing Zip Codes

The U.S. uses 5-digit zip codes to help determine where mail goes. Since mail can be oriented in all sorts of directions, they avoid assigning zip codes that could be confused with a different zip code when read upside-down. For example, 61666 could be confused with 99919 when upside-down, so mail could be accidentally routed to the wrong zip code if both were actual zip codes.

How many zip codes could be confused with a different zip code when read upside-down?

In the example above, 61666 and 99919 would count as two confusing zip codes. Also, zip codes are allowed to start with 0, such as 00501.