You are a cook in a remote area

You are a cook in a remote area with no clocks or other way of keeping time other than a four minute sandglass timer and a seven minute sandglass timer (The kind you turn over - hourglass shaped).
You do have a stove, however, with water in a pot already boiling. Somebody asks you for a nine-minute egg, and you know this person is a perfectionist and will be able to tell if you undercook or overcook the eggs by even a few seconds.
What is the least amount of time it will take to prepare the egg?
And how will you prepare it so that it is neither undercooked or overcooked?

Click here for Answer

The answer is 9 minutes.
First, flip both hourglasses over and drop the egg into the water.
When the four minute timer runs out, flip it again. When the seven minute timer runs out, flip it over.
The egg has been cooking seven minutes.
Now when the four minute timer runs out again after eight minutes flip the seven minute timer back over.
Since the seven minute timer has been running only a minute between flips, there is a minute worth of sand left.
And when that minute runs out, the egg will have been cooking for exactly nine minutes.