Tuesday, February 28, 2012

Pill Problem

You have a two identical bottles of pills, containing pills that look identical except for their internal chemical composition. Looking/tasting/smelling them ,ie, the physical attributes will not let you know the difference.

The Rules
You HAVE to eat exactly one pill each from each bottle everyday.
If you eat more than one pill of each, you die.
If you eat less than one pill of each, you die.
If you do not eat both pills for a day, you die.
The bottle cannot be refilled until the end of prescription month, which basically means if there are 30 pills in a bottle, then that bottle can be refilled only after 30 days.. NOT before.

The Problem
You start eating the pills religiously following the rules for a couple of days. On the third day, lethargy sets in. when you tip the bottles over to get the pills, out of one bottle, two pills fall out instead of one.
Oboy !! Now you are left with three identical pills on one hand without any way of telling them apart ..

Objective
How do you live to get to the end of the prescription month ?


-- Google Interview

No comments:

Post a Comment