Google
Company
Logical Reasoning
Letter Arrangement
->You are given 2 eggs,you have access to 100-storey building.
->Eggs are very Hard &very Fragile means it may break if dropped from 1st floor or may not even break if dropped from 100 floor,both eggs are identical
->you need to figure out the highest floor of building an egg can be dropped without breaking.
->NOW The Question is "HOW MANY DROPS YOU NEED TO MAKE?"(allowed to break 2 eggs during process)
Read Solution (Total 8)
-
- 18 is the answer.
testing floors are 10 20 30 40 50 60 70 80 90 and if still the egg is not broken then go for 91 92 93 94 95 96 97 98 and 99 don't go for 100 because it is certain that if the egg isn't broken on 99 floors then it will be broken on 100th floor .
on other hand if you found in between the test cases if the egg is broken for example lets us assume that during the testing of 60th floor it is broken then proceed testing on 51 52 53 .... up to that certain floor. so, maximum no of test case is 18. - 7 years agoHelpfull: Yes(8) No(1)
- First go to50th floor. If egg breaks then go to 25th floor else go to 75th break. At 25th floor if egg breaks then go to 12th floor else go to 37th floor. Repeat the same procedure.
So basically it uses the concept of binary search. - 6 years agoHelpfull: Yes(2) No(3)
- Answer is 6 or 7.
Explanation: Use binary search. Start dropping from 50th floor, if egg breakes go to 25. If not go to 75. And similarly till 2 eggs are exhausted. This gives the best chance to find the right floor in 6< lg(100) - 6 years agoHelpfull: Yes(1) No(1)
- Only one. Because in the question it has been written that eggs are identical and it may break if dropped from 1st(if fragile) or may not break(if hard)
- 5 years agoHelpfull: Yes(1) No(1)
- I will just drop both eggs on each floor to check whether they are breaking or not.
For ex.
1st Floor: Drops 1: Didn't break
Drops 2nd: didn't break
Will go on until one of the above egg gets break, suppose if one of the egg (assumes 1st) on 5th Floor, then will proceed with 2nd egg until it gets break, so by doing this we can figure out highest and lowest floor where an egg can be broken - 7 years agoHelpfull: Yes(0) No(5)
- 15 steps is enough for find out the highest floor.
- 7 years agoHelpfull: Yes(0) No(3)
- Step 1) Floor_to_check = 1 (initially)
Step 2) check if breaks or not.
If breaks, answer is obvious. If not proceed to 3
Step 3) increase Floor_to_check by a value of 2 and check .
If breaks proceed to step 4 if NOT repeat step 3
Step 4) another egg is left.
Decrease value of Floor_to_check by 1 and check.
If breaks then answer is Floor_to_check
If NOT then answer is Floor_to_check - 1
(Comments : as a result to this, we have to check on roughly half of the floors.) - 7 years agoHelpfull: Yes(0) No(3)
- it should be 14. its minmax problem . easy to solve through code.
- 5 years agoHelpfull: Yes(0) No(0)
Google Other Question