There is a building with 100 floors (can be any positive integer). You have 2 light bulbs. They are special type of bulbs and you have only 2 of them. The specialty of the bulb is that they don’t break easily when dropped from a height. The idea is to find the minimum floor of the building from which the bulb would break. You need to suggest a solution which will take the least number of iterations (for the worst case scenario) to find the minimum floor from which the bulb breaks. Remember that the answer should be mathematically proven to give the minimum iterations. Also note that once you throw a bulb and it doesn’t break, you can automatically recall the bulb without going down the building to fetch it.
Read Answers(10) | 10,699 Views |
How would you find out if a machine’s stack grows up or down in memory?
Read Answers(5) | 10,747 Views |
Explain a database in three sentences to your eight-year-old nephew
Read Answers(10) | 6,994 Views |
If the probability of observing a car in 30 minutes on a highway is 0.95, what is the probability of observing a car in 10 minutes (assuming constant default probability)?
Read Answers(11) | 12,782 Views |
This question was asked at Yahoo.
There are set of ip address set of the form
10.10.10.10 - 20.20.20.20 -> cable, USA
20.20.20.21 - 33.32.31.30 -> DSL, Germany
.
.
.
250.250.250.250 - 256.256.256.256 -> cable, France
Which indicates all ip addresses between 10.10.10.10 to 20.20.20.20 are of type ‘cable’ and belong to the country USA, similarly with other ip address set.
Question:
————
Arrange this data into a data structure in such a way that given an ip address (e.g. 21.21.21.21) retrieve the type of service (cable, DSL.. ) and country (USA, Getrmany..) in the fastest possible way.
Note: the number of such ip address sets could be very large. Also for every ip address between the start(10.10.10.10) and end (256.256.256.256) there is a type and country associated.
Read Answers(7) | 7,858 Views |
How many golf balls can fit in a school bus?
Read Answers(34) | 48,827 Views |
You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?
Read Answers(11) | 13,414 Views |