You need to boil eggs for exactly 9 minutes.
But you have only 2 hourglasses – one measures 4 minutes and the other measures 7 minutes. How do you measure exactly 9 minutes without the process taking longer than 9 minutes?.
Start boiling the eggs and start both the hourglasses – all at the same time.
When the 4-minute hourglass runs out, turn it over immediately so that it will start counting 4-minutes again.
When the 7-minute hourglass runs out, turn it over immediately. At this time, the 4-minute hourglass will have 1 minute remaining.
At the 8th minute, the moment the 4-minute hourglass runs out for the second time, turn the 7-minute hourglass over – it would have been running for exactly one minute.
When the 7-minute hourglass runs out, that will be 9 minutes.