2 Eggs and 100 floor Google Classic question


There is a building of 100 floors
-If an egg drops from the Nth floor or above it will break.
-If it’s dropped from any floor below, it will not break.
You’re given 2 eggs.
Find N

How many drops you need to make?
What strategy should you adopt to minimize the number egg drops it takes to find the solution?

2 eggs 100 floor puzzle

Anand Guru Asked on 12th July 2015 in Google Interview Puzzles.
Add Comment

  • 15 Answer(s)

    It seems optimal number of trials required is only 13 and not 14. But floors numbers are same i.e. 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99, 100

    If the egg breaks at 14 then we need not try from 1 to 13, we can stop at 12 and hence max trials required are 13. Similarly if egg breaks at 27 then we need to try from 15 to 25 max trials which is 11 + 2 trials for 14 & 27 which is again 13. In this way even if we go up to 99 and find that the egg breaks at 99 then we need to try only two trials for 96, 97 which again gives total number of trials equal to 13.

    rushidm Starter Answered on 22nd December 2016.
    Add Comment

    we can test with n+3

    first check with 3, if egg broken,
    try with 2nd floor if egg broken then we can get to know from 1 st floor it does not broken..

    so check with 3 ,6 , 9 ……..

    so n+3 is good i thing

    but i dont know some people choose n+2

    reply if i am wrong.

    sirivellamadhu Starter Answered on 10th May 2017.
    Add Comment

    Drop one egg from the second floor and keep going upwards until the egg breaks.
    Second floor because all eggs thrown below nth floor doesnt break.

    Balesh Talapady Starter Answered on 15th November 2015.

    We need minimum number of attempts

    on 15th February 2020.
    Add Comment

    The answer is much simpler, and it is N drops. Let’s assume that the egg breaks at floor 20, then you would make a drop on floor 1, it will not break, and then again on floor 2 all the way to floor 20. On the 20th floor it will break, here we know what floor the egg break (which is also going to be the Nth drop) and we will still have one egg.

    leonarther16th Default Answered on 11th February 2016.
    Add Comment

    Drop one egg from the first floor. If it doesn’t break drop it from the second floor. Keep dropping until the egg breaks. The floor the egg was dropped from when it broke is N. You broke one egg and have one egg left over.

    you can reduce the number of drops by starting at say 10, but you’ll have to sacrifice one egg

    Vega Default Answered on 24th September 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.
  • More puzzles to try-