This question already has an answer here:
- Nerds, Jocks, and Lockers 4 answers
I remember this one from an interview:
There is a room with 100 light bulbs (numbered from 1 to 100) lined up in a row. All the bulbs are off. 100 people are lined up in front of the room. The first person enters the room and switches on every bulb, and exits. Then the second person enters and flips the switch on every second bulb (bulbs 2, 4, 6, 8, ... are off). The third person enters and flips the switch on every third bulb (3,6,9,...) and so on until the 100th person exits the room. How many of the light bulbs are on after the 100th person has exited the room?