Interview Question

Program Manager Intern Interview(Student Candidate) Seattle, WA

n story building. You have k eggs. Find out which floor the

  egg breaks on when dropped from that floor.
Answer

Interview Answer

1 Answer

0

Go to floor n/2 and drop it. if it breaks, go to floor n/4, else go to floor 3n/4. Basically do a binary search. I don't think you can do this if k < lg(n)

Zach on 2013-01-08

Add Answers or Comments

To comment on this Question, Sign In with Facebook or Sign Up