Cisco Systems

  www.cisco.com
  www.cisco.com

Interview Question

Engineering Interview Austin, TX

* 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
Answer

Interview Answer

4 Answers

0

Only 1 drop

Ahmed Al-Shinhab on Jan 10, 2012
0

I think the answer is 14. Let us assume that any number of breaks are allowed. The idea is to get the square root of the number of floors and to drop them in all... here it is 100 so drop them in an interval of 10. Thus say after 9 attempts, the egg breaks in 100 th floor and remain unbroken in 90th. Now we apply binary search to find the remaining floors. say we drop it in 95 and it doesnot break(11 attempt). Now drop it from 97(12) and say it does not break.. Now drop it in 98(13) it does not break. drop it in 99 (14)....

Avinash on Feb 5, 2012
1

Take egg1; drop it from floor 1.
Take egg2; drop it from floor 3.
If egg 1 broke, the answer is 1st floor.
If egg2 broke but egg1 did not then the answer is floor 2.
If none of them break,
Take egg1 to floor 5 and egg2 on floor 6.
If egg1 breaks, then it's floor 4.
If egg2 breaks but egg1 does not break, then it is floor 5th.
If none of them break, then
Take egg1 to floor 8 and egg2 to floor9. and so on.. You basically you covered 4 floor on the first try.. and you process 3 floors at a time... so you need 33 tries in the worst case..

Jack InThe Box on Mar 1, 2012
0

The answer is the top floor of any building in which this question is presented. They state early on that the eggs could have the possibility to survive the 100 floor drop due to the hardness of the egg.
That being said then the answer is 100 and 0 drops since we have this information.

Talosfox on Dec 1, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.