100 doors in a row Interview puzzle
You have 100 doors in a row that are all initially closed. You make 100
passes by the doors starting with the first door every time. the first time through
you visit every door and toggle the door (if the door is closed, you open it, if its
open, you close it). the second time you only visit every 2nd door (door #2, #4,
#6). the third time, every 3rd door (door #3, #6, #9), etc, until you only visit the
100th door.
Question: what state are the doors in after the last pass? which are open which
are closed?
You can figure out that for any given door, say door #42, you will visit it
for every divisor it has. so 42 has 1 & 42, 2 & 21, 3 & 14, 6 &7. so on pass 1 i will
open the door, pass 2 i will close it, pass 3 open, pass 6 close, pass 7 open,
pass 14 close, pass 21 open, pass 42 close. for every pair of divisors the door
will just end up back in its initial state. so you might think that every door will end
up closed? well what about door #9. 9 has the divisors 1 & 9, 3& 3. but 3 is
repeated because 9 is a perfect square, so you will only visit door #9, on pass 1,
3, and 9… leaving it open at the end. only perfect square doors will be open at
the end.
Your Answer
More puzzles to try-
Finding hidden key in kitchen riddle
Key got lost in the kitchen, I shoot a picture for you to help me. Can you?Read More »A Man and His Three Sons
A father told his three sons he would die soon and he needed to decide which one of them to ...Read More »What loses its head in the morning?
What loses its head in the morning and gets it back at night?Read More »Playing card riddle
There is a deck of 100 initially blank cards. The dealer is allowed to write ANY positive integer, one per ...Read More »Man in the Hotel
There was a man he lives in a hotel each morning he presses the first floor button each evening if ...Read More »What letter is missing From the center
How do you get out alive?
Imagine you are swimming in the ocean and a bunch of hungry sharks surround you. How do you get out ...Read More »Months Puzzle
In a year there are 12 months. 7 months have 31 days. How many months have 28 days?Read More »Heir and impostor
After the king dies, two men, the true heir and an impostor, both claim to be his long-lost son. Both ...Read More »How many footballers and cricketers are present?
There are 100 athletes (cricketers and footballers) gathered at a sports banquet. Atleast one of them is a cricketer. Given ...Read More »Next is Best
Find the next number in the series. 1 10 24 43 67 ?Read More »Soldiers crossing river
An army general wanted ten soldiers to cross a river. There was no bridge and the soldiers could not swim. ...Read More »Murder or Suicide Puzzle
Jacob jumped off the top of building a suicide attempt not knowing that a safety net is already there near ...Read More »Why is it better to have round manhole covers than square ones?
Why is it better to have round manhole covers than square ones?Read More »Man became millionaire after rice trade puzzle
A man buys rice at $1 a pound from American growers and sells them at $0.05 a pound in Africa. ...Read More »Animal rebus puzzle
Can you find the animal hidden in this rebus picture-Read More »How would you make 11 with six zeros
How would you make 11 with exactly six zeros and no other digits, You can perform any mathematical operation.Read More »Key Hardest to Turn
Name a key which is hardest to turn.Read More »Piegons and farmer Brain Teaser
Five pigeons are sitting on a fence. The farmer comes out and shoots one. How many are left?Read More »6 Teacher and theif puzzle
6 Teachers were going to school altogether. A chain snatcher steals a chain Telugu teacher – Donga Donga, Eng teacher ...Read More »