Google's Employment Applicant's Hourglass Problem

Google’s Employment Applicant’s Hourglass Problem

Ref: March 2012 issue of Wired magazine.

It seems the Google job interview process requires a problem to be solved. I’ll take this hourglass problem, “Using only a four-minute hourglass and a seven-minute hourglass, measure exactly nine minutes.”

Solution Principle: Use one hourglass to measure out a smaller amount of time on the other hourglass. Repeat until you have the correct time periods stored in each hour glass such that when you add their times together by turning the second one up when the first finishes you get the correct total time of nine minutes.

I will refer to the 4 minute hourglass as A and the 7 minute hourglass as B.

  1. Turn up A and B together. When 4 mins have elapsed on A stop the 7 min hourglass B by laying it horizontal. You now have a 3 min hourglass if you turn B one way or a four min hourglass if you turn B the other way.
  2. Turn up A and B so that B will measure 3 mins. After 3 mins stop A by laying it horizontal. You now have a 1 min hourglass if you turn A one way or a 3 min hourglass if you turn it the other way. B has returned to being a 7 min hourglass.
  3. Turn up A and B so that A will measure 1 min. After 1 min stop B by laying it horizontal. You now have a 1 min hourglass if you turn B one way or a 6 min hourglass if you turn it the other way. A has returned to being a 4 min hourglass.
  4. Turn up A and B so that B can potentially count 6 mins but stop it when 4 mins have elapsed on A by laying it horizontal. You now have a 5 min hourglass if you turn B one way or a 2 min hourglass if you turn it the other way. A is still a 4 min hourglass.
  5. Turn up A to count 4 mins. As soon as 4 mins have elapsed turn up B in the way that will count 5 mins. 4 mins + 5 mins = 9 mins. QED.

END OF POST


Posted

in

, , ,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.