Want a Free Job Posting?

Buy a job posting today and the second one is on us. For a limited time only. Act Now.

Interview Question


I got stuck at the logic question, the answer didn't strike

  me at that time. The question was : There are 100 bulbs, all off at first. In the 1st round, all bulbs are switched on, in the second round every second bulb changes state, in the third round every third bulb changes state and so on. Which all bulb will be on at the end of 100th round?

Interview Answer

2 Answers


the answer is all the square numbers bulbs are on.

Xin Du on May 13, 2013

All the numbers which which have odd number of factors in range 1-100 will be on. For example the number 99 has 6 possible factors 1, 3, 9, 11, 33, 99. It will be OFF. But 100 has 1, 2 , 4 , 5, 10 , 20 , 25, 50, 100. It will be on.

Ashish on Dec 17, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.