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.

Continue reading “How Many Friday the 13th in a Year”Brain teasers you might encounter in a finance, consulting, or engineering interview

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.

Continue reading “How Many Friday the 13th in a Year”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:

- Loaded with one bullet?
- Loaded with bullets in two random chambers?
- 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.

Continue reading “Russian Roulette Riddle”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:

- Sam: I know Prada does not know
*x*and*y*. - Prada: Well now I know
*x*and*y*. - Sam: Ah, now I also know
*x*and*y*.

Can you figure out *x* and *y* using this information?

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.

Continue reading “Reroll the Die”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?

How many trailing zeros does 1000! have?

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

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.

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.

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?

Continue reading “I Like the Numbers 4 and 5”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?

View SolutionBrain 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**.

*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?

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.

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.

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.

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?

Continue reading “Card Flipping Endgame”