1 views

Uploaded by Mitansh Jain

This puzzle can just blow up your mind. cracking it can land you up with worthy amount of Rs.1 crore as it was asked in a google interveiw.

- tcdsp17-featureengineering-extendedversion-170719211326.pdf
- t3_v2_sol
- Solution 1
- Direction Finding Using 3d Array Geometry
- Goal Plot 1 (2)
- Rain Streaks Removal From Single Image
- Linux Scheduling
- btree
- StandardPSO.m
- ActiveLearningEx01
- Output Spss
- Filter Notes - Extra
- QWL
- Power Flow
- MergeSort 2
- 2 d Fourier Transforms
- Runge Kutta
- #1 Problems 1
- FALLSEM2017-18 MAT3004 TH SJT224 VL2017181002446 Reference Material I Inverse Gauss
- Dictionary Learning Based Image Enhancement for Rarity Detection

You are on page 1of 2

* Eggs can be very hard or very fragile means it may break if dropped from the f

irst floor or may not even break if dropped from 100 th floor.Both eggs are iden

tical.

* You need to figure out the highest floor of a 100-storey building an egg can b

e dropped without breaking.

* Now the question is how many drops you need to make. You are allowed to break

2 eggs in the process

If you are one of the people who likes to solve a puzzle before seeing the answe

r you must quit the blog now and come back later for checking the answer.

Now that this is a Google interview question I am taking the normal "Interview-S

tyle" of solving a problem. Simply saying thinking aloud through the solution fr

om worst to the best correcting the flows optimizing the solution or taking the

5-minute hard thinking acting pause to a problem, which you know already and jus

t want to make your interviewer think that you are a challenge lover.

Solution

Drop the first egg from 50.If it breaks you can try the same approach for a 50-s

torey building (1 to 49) and try it from 25th floor. If it did not break try at

75th floor. And use linear search with the remaining portion of storey we need t

o test. For example if the first egg breaks at 50 we need to try all possibiliti

es from 1 to 49.

Now this looks a feasible solution. In computer student's jargon do a binary sea

rch with first egg and linear search with the second one. Best case is log (100)

and worst is 50.

Now the optimal solution for the problem is that you figure out that you will ev

entually end up with a linear search because you have no way of deciding the hig

hest floor with only one egg (If you broke one egg and you have to find the answ

er among 10 all you can do is start from the lowest to the highest and the worst

is the total number of floors). So the whole question grinds up to how to make

use of the first egg to reduce the linear testing of the egg.

(For strict computer science students, well this problem can be solved using bin

ary search on the number of drops needed to find the highest floor.)

Now let x be the answer we want, the number of drops required.

So if the first egg breaks maximum we can have x-1 drops and so we must always p

ut the first egg from height x. So we have determined that for a given x we must

drop the first ball from x height. And now if the first drop of the first egg d

oesn t breaks we can have x-2 drops for the second egg if the first egg breaks in

the second drop.

Taking an example, lets say 16 is my answer. That I need 16 drops to find out th

e answer. Lets see whether we can find out the height in 16 drops. First we drop

from height 16,and if it breaks we try all floors from 1 to 15.If the egg don t b

reak then we have left 15 drops, so we will drop it from 16+15+1 =32nd floor. Th

e reason being if it breaks at 32nd floor we can try all the floors from 17 to 3

1 in 14 drops (total of 16 drops). Now if it did not break then we have left 13

drops. and we can figure out whether we can find out whether we can figure out t

he floor in 16 drops.

Lets take the case with 16 as the answer

1 + 15 16

1 + 14 31

1 + 13 45

1 + 12 58

1 + 11 70

1 + 10 81

1 + 9 91

1 + 8 100

task

if breaks at 31 checks from 17 to 30 in 14 drops

.....

Now finding out the optimal one we can see that we could have done it in either

15 or 14 drops only but how can we find the optimal one. From the above table we

can see that the optimal one will be needing 0 linear trials in the last step.

So we could write it as

(1+p) + (1+(p-1))+ (1+(p-2)) + .........+ (1+0) >= 100.

Let 1+p=q which is the answer we are looking for

q (q+1)/2 >=100

Solving for 100 you get q=14.

So the answer is: 14

Drop first orb from floors 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99, 100... (i

.e. move up 14 then 13, then 12 floors, etc) until it breaks (or doesn't at 100)

.

Please feel free to correct or post any comment on the solution or the answer.

Links I found useful

- tcdsp17-featureengineering-extendedversion-170719211326.pdfUploaded bykishkp
- t3_v2_solUploaded byPatSramek
- Solution 1Uploaded byforwarddump
- Direction Finding Using 3d Array GeometryUploaded byMohammed Nawaz Shaik
- Goal Plot 1 (2)Uploaded bySthefano Asencio
- Rain Streaks Removal From Single ImageUploaded byEditor IJRITCC
- Linux SchedulingUploaded byMalek Rahma
- btreeUploaded byJyoti Ahlawat
- StandardPSO.mUploaded bySutha Sangapillai
- ActiveLearningEx01Uploaded bykleeph
- Output SpssUploaded byPipit Rostika
- Filter Notes - ExtraUploaded byshahrul217
- QWLUploaded byChintan P. Modi
- Power FlowUploaded bysayedmh
- MergeSort 2Uploaded bySayan Chatterjee
- 2 d Fourier TransformsUploaded byAbdurrahman Hazer
- Runge KuttaUploaded bybarbaroj
- #1 Problems 1Uploaded byLynne Nguyen
- FALLSEM2017-18 MAT3004 TH SJT224 VL2017181002446 Reference Material I Inverse GaussUploaded byMEHTA KARAN HEMENDRA 15BCE0877
- Dictionary Learning Based Image Enhancement for Rarity DetectionUploaded byAnshik Bansal
- Compelec Lms AlgorithmsUploaded bytkbattula
- plantlayoutUploaded byArunkumar Myakala
- 02 DS and Algorithm Session 02Uploaded bySrinivasa Helavar
- DSP Lab External QuestionsUploaded byharis_j
- Numerical AnalysisUploaded byJon West
- Control Sys Two ExpUploaded byMohammed Abdul Jabbar
- Class 1Uploaded byYogesh Appu
- FIR Filter ModelUploaded byPraveen Kumar Arjala
- Tqwt Orth CopyUploaded byjuan.vesa
- up1 math sUploaded bymasyati

- TTUploaded byMitansh Jain
- NSEC Solved Paper 2007Uploaded byMitansh Jain
- NSEC Solved Paper 2007Uploaded byMitansh Jain
- Mypat Jeea Jeem Bitsat2015Uploaded byMitansh Jain
- gajar halwa.txtUploaded byMitansh Jain
- India GateUploaded byMitansh Jain
- KVPY 2010 Stream SA Solved PaperUploaded byNikhilPrakash
- a puzzle of crore and eggUploaded byMitansh Jain

- toleransi 1Uploaded bytrisakti.agus
- Illustrated Over v 00 Pet tUploaded bysohrabghafoor
- Celluar GA ThesisUploaded byvelayya
- Implementation of Six Sigma Using DMAIC Methodology in Small Scale Industries for Performance ImprovementUploaded byIJMER
- BoardingPass.pdfUploaded byAhsan Mahmood
- Deakin University_Travel Survey Results_ Geelong Waterfront Campus_2011-FINALUploaded byBoitor Melania
- Gas Fire InstructionsUploaded byjangleeuk
- Environmental Consequences of Offshore Wind Power GenerationUploaded bysebascian
- Restroration of Flood Damaged Under Arambagh Sub Divn.Uploaded byanirbanpwd76
- Cash Valve Product OverviewUploaded byesteban
- Adsorption of Reactive Black 5 From an Aqueous Solution - Equilibrium and Kinetic StudiesUploaded byDr. Arif Hidayat
- CS3000 Automatic Safety Cover BrochureUploaded byCOVERSTAR
- IRJET-A Review of Sliding Mode Control Of DC-DC ConvertersUploaded byIRJET Journal
- MidiSport 2x2 Anniversay ManualUploaded bynorthtrader
- FlexNetOperationsSuccessStory FlexeraUploaded byFlexeraSoftware
- Jimmy Smith - Classic Blues Drawbar Settings for B-3 - Jazz Bulletin BoardUploaded byShadad Jadaân Muhammaed Said
- ECO It ManualUploaded byMarko Milosevic
- T5 B70 Saudi Flights FBI Docs 1 of 4 Fdr- Passenger Interview Reports Tab- Entire Contents- FBI Doc Req 30- Withdrawal Notice 682Uploaded by9/11 Document Archive
- Engineered Wood Products Guide April09Uploaded byDu Nguyen
- wood cutting industry in moratuwaUploaded byIsuru Kodikara
- nickemyb02Uploaded byErland Prasetya
- Second language acquisition.pdfUploaded byFátimaAndréia Tamanini
- 1900-65-fsUploaded bysgrinev
- Chapter 13 Railway manualUploaded byibnesafi
- 4 Methodology for Product Development in ArchitectureUploaded byAnggun Mentari
- 2004-1218Uploaded byArcosFrankJuanManuel
- MIMO Method for CombinationUploaded bySandrine Gallard
- 5. Tong Hsing Mr. Ru 092112DLUploaded bydenghuei
- PPT - 7590Uploaded byJai Rajesh
- 16.wear debris analysis-a meaningful condition monitoring technique for industrial drives.pdfUploaded bySreekumar Rajendrababu