Interview Question: How Many Zeros in 100 Factorial (100!)?
Strategy and Approach to Answering a Problem Solving Interview Question
If you get asked a problem solving question in an interview, remember that they are NOT looking for the RIGHT answer. They are evaluating the approach you use to think out and solve the problem. A strong candidate demonstrates the following:
- Evaluates and understand the scope of the problem
- Communicates assumptions
- Demonstrates quantitative analytical skills
- Answers the question that has been asked. You’d be surprised how many candidates get lost in the analysis and solve for a different question than what was asked.
How to Answer this Problem Solving Interview Question
A factorial is, 100! = 100 * 99 * 98 * … * 2 * 1
We know that each pair of 2 and 5 will give a zero. If we perform prime number decomposition on all the numbers in 100!, it is obvious that the frequency of 2 will far outnumber of the frequency of 5. So the frequency of 5 determines the number of trailing zeros. Among numbers 1,2, … ,99, and
100, 20 numbers are divisible by 5 (5, 10,…, 100 ). Among these 20 numbers, 4 are divisible by 5^2 ( 25, 50, 75, 100 ). So the total frequency of 5 is 24 and there are 24 zeros.
Note: For this problem solving job interview question, there is an actual logical answer, however the interviewer will want to evaluate your thinking process. In answering the interview question, the lead up to your answer will be just as important as the actual answer itself.
For more problem solving, brain teasers, riddles, puzzles, logic job interview questions, please check our out Problem Solving Interview Section.
List of Problem Solving Interview Questions Used by Top Firms (e.g., Microsoft, Google, Goldman Sachs)
- 100 Prisoners and a Light Bulb Interview Question
- 5 Pirates and 100 Gold Coins Interview Question
- Birthday Problem Interview Question
- Bridge Crossing Interview Question
- Burning Rope Interview Question
- Card Game Interview Question
- Crossing the River Interview Question
- Dog Show Interview Question
- Equal Halves of Rectangular Birthday Cake Interview Question
- Estimate the market demand in gallons for skim milk consumed in the U.S. in a given year.
- How many golf balls can you fit in a school bus?
- How many street lamps are there in Manhattan?
- How many times a day does a clock’s hands overlap?
- How Many Zeros in 100 Factorial (100!)?
- How much would you charge to wash all the windows in New York City?
- In a country, in which every family wants a boy
- Rising Tide Interview Question
- The Fermi Problem – How many Piano Tuners are there in Chicago?
- The Heaviest Ball Interview Question
- The Monty Hall Interview Question
- The Race Interview Question
- Tiger and Sheep Interview Question
- Why are manhole covers round?