How Techies try to light up their imagination!

The electric bulb of Thomas Alva Edison is by far the greatest innovation known to mankind. Former President Abdul Kalam used to often mention the bulb as the greatest innovation. Naturally the interviewers in IT companies cannot think beyond the bulb. The bulb analogy is the main ingredient of IT interviews. The following questions prove the point. A Facebook entry question: You have two bulbs and are at a 100-storey building. If you want to burst the bulb, from which floor should you throw it? Number of minimum tries is the best answer. Techies have found two options for answering this question. First option: Minimum 19 tries. How? You climb 10 floors and drop a bulb. If it breaks, you will have to start the process from the first floor, till it breaks. You then have the answer of the right floor. Assuming the bulb doesn't break from the 10th floor, you have to climb the 20th floor and drop the bulb. If it breaks from that height, you use the other bulb from the 11th to 19th floor to determine the answer. This is answer of the majority of techies. Option 2: The best possible answer is, mathematically, the 16th floor. If the bulb doesn't burst from the 16th floor, you go to the 31st floor. If the bulb bursts from the 31st floor drop, you repeat the process from 17th to 30th floor to determine the exact height. If the bulb doesn't burst from the 30th floor, then you go to 48, 58, 70, 81, 91 and 100 and so on to determine the exact floor drop that will burst the bulb. You need a maximum 16 attempts if you go by this method. Then again the bulb analogy: You have three switches. One of the three will light up the bulb in a floor below, which you will not see. How do you determine the right switch? You have one chance of going down below to check whether you have used the right switch that lighted the floor. This question was asked of a software engineer aspirant. The ingenious answer to the software puzzle is as follows: You choose the switch at random, and let it be switched on for 10 minutes only. Then you operate the second switch. Now you go down. If you find the bulb there hot, then the previous attempt was the right switch. If you find the room lighted, you have found the right switch in the second attempt. If you find both the bulbs cold, then the third unused switch is the right one.


More News