Goldman Sachs Interview Question
633 Interview Reviews |
Back to all Goldman Sachs Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Senior Software Engineer at Goldman Sachs:
Classix 2 eggs problem . * You are given 2 eggs. * You have access to a 100-storey building. * Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor.Both eggs are identical. * You need to figure out the highest floor of a 100-storey building an egg can be dropped without breaking. * Now the question is how many drops you need to make. You are allowed to break 2 eggs in the process
See more for this Goldman Sachs Senior Software Engineer Interview
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (6)
1 of 2 people found this helpful
Secondly, although your answer is correct, your formula is wrong. The general form is ceiling[ (sqrt(8n+1)-1) / 2], with n = # of stories.
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
0 of 1 people found this helpful
Otherwise simple mathematical inequality eqn q(q+1)/2>=100 will solve the problem.
Helpful Answer?
Yes |
No
Inappropriate?
0 of 1 people found this helpful
The least value of y gives the best solution:
here, x^y +x-1 =99 for the worst case best satisfactory ans.
Helpful Answer?
Yes |
No
Inappropriate?
3 of 3 people found this helpful
Let's say that x is the optimal number of throws required. And, for time being let's say x=20. Then,
You would do the first throw from 20th floor and if egg breaks you would do a linear operation of throws from 1st to 20th floor to find which floor the egg breaks.
However, if the egg doesn't break then you will throw from 39th floor, as you are now one throw less. Following this logic
20
39
57
73
88
102 but you only have 100 floors thus this is not the right answer.
x + (x-1) + (x-2) + ... + 1 = 100
x(x+1)/2=100
which gives x=14 which is the optimal number of throws required.
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up



0 of 8 people found this helpful
by matt:
The answer is 14. n(n+1)/2