Groupon Interview Question: Brain teaser question: You ha... | Glassdoor

Interview Question

Software Developer Interview(Student Candidate)

Brain teaser question: You have two glass balls and you

  wanna test how strong they are by dropping them from a 100-story building. What's the algorithm that requires minimum number of trails.
brain teaser

Interview Answer

2 Answers


Start at sqrt(number-of-floors), or 10 in this case. Increase by that same number until one breaks. Go back down by that number and go up by 1 for the remaining tests.

Michael on Mar 1, 2013

go to 19th floor if the egg breaks go from 1-18 else 38 like that

mani deepak on Aug 24, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.