Tag Interview Brain Teasers

Brain teasers you might encounter in a finance, consulting, or engineering interview

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.
Continue reading “7 Quant Interview Questions and Answers”

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?

Continue reading “Lions and Sheep”

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.

Continue reading “7 Actual Brain Teaser Interview Questions and Answers”

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.

Continue reading “Throwing Rocks Off a Boat”

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?

Continue reading “Card Flipping Endgame”

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?

Continue reading “Number Deduction”

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?

Continue reading “Fake Coins Proof”