Interview Question
Country: United States
@Mitra,
I think Murali solution is correct because he is waiting till first rope burnt completely means 30 min passed so second rope will take next 30 min to burn even though it has even density.
Assuming that both ropes are identical...
Burn the 1st rope from both ends and lay the 2nd one next to it.
-> Cut the 2nd rope in 2 pieces were the fire meets on the 1st rope (not necessarily the midpoint because of the uneven distribution)
-> Burn both of the 2 pieces of the 2nd rope from both ends and start boiling the egg
-> The egg is done when all rope pieces are burnt
I am hating you for this reply.. The question mentions that the rope is uneven, so if you fold it, it won't burn for exact 15 minutes!!
To make things clear for you if a rope has 4 portion buring for 8 12 20 20 minutes, two time folded rope will burn for 15 minutes.
I am hating you for your reply. The question clearly mentions that the ropes are uneven, if you fold it and burn the whole rope may not burn in 15 minutes. To make it clear say the time distribution across the 4 parts of rope is 8 12 20 20, then if you fold and burn it will burn for 20 minutes!
Does this logic make any sense?
Measure density of both ropes. Cut second rope up in a way with density of first rope in mind, and attach second rope to first rope in a way that density is now evenly distributed.
Burn one side of rope and start boiling egg. Once 1/8th of rope is burnt, stop boiling egg.
Note: 1/8th of rope to burn because new rope will burn for 2hrs total, given that each burns for 1 hour each.
Another solution is to cut one rope into two pieces. Start to burn both pieces from both ends and start to cook the egg. When the last piece is burned 15 mins have passed.
Then you have one rope left for yet another egg :-)
i appretiate the logic but
no guarrenty to take xact 15 min for whole rope to burn, due to uneven density.
Known question. Burn the first rope from both the ends and the second rope from only one end. When the first rope completely burns away, 30 minutes would have elapsed and the second rope can now burn for 30 more minutes.
- Murali Mohan February 04, 2014Now start burning the second rope from the second end and start boiling the egg. Stop boiling the egg when the second rope completely burns as it would now measure 15 mins.