Answer: Only doors 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100 stay open. That is the 100 doors puzzle answer.
The 100 doors puzzle answer surprises most candidates because the result has nothing to do with simulating all 100 passes. Instead, it comes from one clean idea: a door ends open only when it is toggled an odd number of times, and only perfect squares are toggled an odd number of times. This walkthrough shows the small case first, then the divisor proof, then the full list, so you can explain it in an interview without memorizing anything.
The Question as Asked
There are 100 doors in a row, and all 100 start closed. You make 100 passes. First, you toggle every door. Next, you toggle every second door. After that, you toggle every third door. The pattern continues, and on the 100th pass you toggle only door 100. At the end, which doors are open and which are closed?
This exact setup appears as an FTI Consulting analyst interview question in Glassdoor interview reports. For this post, the question is used here for the setup only. The solution below is original, worked from first principles, and does not copy any published answer.
100 Doors Puzzle Answer in Small: Try 10 Doors First
Do not start with 100 doors. For example, start with 10 doors and 10 passes, and watch the pattern appear. The table below lists the doors left open after each pass.
| Pass | Doors toggled | Doors left open |
|---|---|---|
| 1 | Every door | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 2 | 2, 4, 6, 8, 10 | 1, 3, 5, 7, 9 |
| 3 | 3, 6, 9 | 1, 5, 6, 7 |
| 4 | 4, 8 | 1, 4, 5, 6, 7, 8 |
| 5 | 5, 10 | 1, 4, 6, 7, 8, 10 |
| 6 | 6 | 1, 4, 7, 8, 10 |
| 7 | 7 | 1, 4, 8, 10 |
| 8 | 8 | 1, 4, 10 |
| 9 | 9 | 1, 4, 9, 10 |
| 10 | 10 | 1, 4, 9 |
In short, after 10 passes, only doors 1, 4, and 9 stay open. Those are the perfect squares up to 10: 1 times 1, 2 times 2, and 3 times 3. That is the clue. The 10-door case is small enough to check by hand, and it already points at the general rule.
Why Only Squares Survive: The Divisor Proof
To see why, here is the step that turns a pattern into a proof. A door is toggled on pass n exactly when n divides the door number. Door 12, for example, is toggled on passes 1, 2, 3, 4, 6, and 12. That is 6 toggles, an even number, so door 12 starts closed and ends closed.
In general, divisors normally come in pairs. For door 12, the pairs are (1, 12), (2, 6), and (3, 4). Each pair contributes two toggles, and two toggles cancel out: open, then closed again. Consequently, any door with paired divisors ends closed.
However, perfect squares break the pairing. Door 36 has divisors 1, 2, 3, 4, 6, 9, 12, 18, and 36. That is 9 divisors, an odd number, because 6 pairs with itself: 6 times 6 equals 36. The pairs are (1, 36), (2, 18), (3, 12), and (4, 9), plus the unpaired 6. As a result, nine toggles leave door 36 open. Door 1 is the same idea at the smallest scale: it has only one divisor, itself, so it is toggled once and stays open.
Put together, the logic is short. Therefore, a door ends open exactly when its toggle count is odd. Its toggle count equals its divisor count. Only perfect squares have an odd divisor count. So only perfect squares stay open. No simulation of 100 passes is needed, and no door needs to be tracked one by one.
The Full List: Every Door Left Open After 100 Passes
Overall, the perfect squares from 1 to 100 are the squares of 1 through 10. That gives 10 open doors and 90 closed doors, and it is the complete 100 doors puzzle answer in list form.
| Open door | Square root | Check |
|---|---|---|
| 1 | 1 | 1 times 1 |
| 4 | 2 | 2 times 2 |
| 9 | 3 | 3 times 3 |
| 16 | 4 | 4 times 4 |
| 25 | 5 | 5 times 5 |
| 36 | 6 | 6 times 6 |
| 49 | 7 | 7 times 7 |
| 64 | 8 | 8 times 8 |
| 81 | 9 | 9 times 9 |
| 100 | 10 | 10 times 10 |
Door 100 deserves a note because candidates often doubt it. In fact, door 100 is toggled on every pass that divides 100, which is 9 passes: 1, 2, 4, 5, 10, 20, 25, 50, and 100. Nine is odd, so door 100 ends open, even though its previous touch was back on pass 50.
Traps That Catch Good Candidates
First, do not try to simulate all 100 passes in your head. Interviewers notice when a candidate starts listing passes, because it signals brute force instead of structure. The small case plus the divisor argument is faster and far more convincing.
Second, do not guess that half the doors stay open. On the other hand, toggling is not random, and it is not balanced. Only 10 of the 100 doors survive, which is a useful check on any answer that claims a large open set.
Third, do not confuse prime doors with open doors. A prime door such as 7 has exactly two divisors, 1 and itself, so it is toggled twice and ends closed. Primes are the opposite of the answer, not a shortcut to it.
Fourth, watch the starting state. The puzzle states that all doors start closed. If the doors started open, the answer would flip: every non-square would end open and every square would end closed. Stating the starting state out loud at the start of your answer protects you from that follow-up.
What the Interviewer Is Testing in the 100 Doors Puzzle Answer
This puzzle tests four things, and none of them is arithmetic speed. First, it tests whether you shrink a big problem to a small case you can check, which is why the 10-door table is the strongest opening move. Second, it checks whether you translate a physical action, toggling, into a mathematical condition, the divisor count. Third, it looks at whether you spot pairing, the idea that most divisors cancel in twos and only the self-paired square root survives. Finally, it tests how you communicate: a candidate who says the answer, shows the small case, and then gives the proof in three sentences sounds ready, while a candidate who only recites the list sounds rehearsed.
Finally, if the interviewer pushes further, two follow-ups are worth having ready. For example, for 1,000 doors, the open doors are the squares up to 1,000, and since 31 times 31 equals 961 and 32 times 32 equals 1,024, there are 31 of them. Similarly, for the flipped version, where all doors start open, the open set becomes every door except the 10 squares listed above.
Try It Yourself Before the Interview
To prepare, work the 10-door case on paper once, without looking at the table above. Then write down the divisor pairs for 12 and for 36, and say the pairing argument out loud in under a minute. If you can do that, you have the 100 doors puzzle answer for any door count the interviewer names. In short, the method scales, and the list never needs memorizing.
One More Puzzle to Try
If you liked the toggle logic here, try the Water Jug Puzzle Answer: Measure 4 Litres, where a different small-case habit, working backwards from the target, does the heavy lifting. Alternatively, test your day-by-day reasoning with the Microsoft Gold Bar Puzzle: Pay 7 Days, which rewards the same kind of structural insight.

Lauren Brooks is a finance professional writing on professional exams, study strategies, and finance careers.
Leave a Reply