Bloomberg L.P. Interview Question
801 Interview Reviews |
Back to all Bloomberg L.P. Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Developer at Bloomberg L.P.:
Can't remember the details, but was asked a question regarding dropping eggs off high buildings to determine the height at which an egg would first break.
| Tags: | brain teaser See more , See less 8 |
See more for this Bloomberg L.P. Software Developer Interview
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (4)
0 of 2 people found this helpful
the worst case is 7 times.
Example: drop at 50, if it break, drop at 25, if it doesn't break, drop at 37,and so on.
DId I misunderstand the question or not?
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up
1 of 1 people found this helpful
by JH:
The question is you have two eggs and a building that is 100 ft tall. The egg will break on an integer at height greater than or equal to 1ft or less than or equal to 100ft. You have 2 drops to find out what the highest point is at which you can drop an egg without it breaking. What is the fewest number of drops it would take to find the 'breaking point.'
Actual Answer
14
Explanation
Drop from 14 ft, if it doesn't break add 13 ft, then 12 ft, etc...till you get to 99 (After adding 4). If it doesn't break at 99, you know the answer is 100ft. If at any point it breaks, you would drop it at a hight 1ft greater than the last drop point from which the egg did not break. You keep dropping from 1ft higher until it breaks. At no breaking point is it possible for it to take more than 14 drops. This works for any height between 1 and 100 as long you add 1 less foot to each additional initial point where the egg did not break. This works because the total maximum drops after the first break at each initial dropping level decreases each time an additional initial drop is required. There is also some mathematical theory or algorithm that explains this.
Example 1: Breaks at 14ft (first drop), you test heights 1ft - 13ft. If the breaking point was 13ft, It took only 14 total drops to find this point. Test any other height.