Google Ads

Most asked interview question - Hourglass

Rajesh is one of the finalist in an IQ championship. In the final phase he has provided with two hourglasses.
One of them can measure 12 minutes while the other one can measure 15 minutes.
He is asked to measure exactly 18 minutes using those two hourglasses. How will he do it ?
18 minutes can be easily measured using these two hour glasses.

Step 1: He will start both the hourglass.

Step 2: The moment the 12 minute hourglass is empty, he will invert it. (Start again by rotating it)

Step 3: When the 15 minutes hourglass is empty, he will invert the 12 minute hourglass.
In step 3, we have 15 minutes. Since we inverted the 12 minute hourglass in step 2, it started fresh and was going just for 3 minutes (15-12=3). In this manner when it is reversed when the 15 minute hourglass is finished, it will have 3 minutes of sand left. This time when the sand finishes, he will have measured 18 minutes. (15+3=18)

No comments

Powered by Blogger.