Interview Question


Country: United States




Comment hidden because of low score. Click to expand.
7
of 7 vote

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.

Now 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.

- Murali Mohan February 04, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
2
of 2 votes

@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.

- Sanjay Gupta February 04, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Thanks. I discussed it with a friend over dinner. Got it now :)

- TheMitraBoy February 04, 2014 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

1. Start burning the 1st rope from both end and 2nd rope from one end
2. When first rope finished burning (which take exactly 30 minutes to burn from both end) torch the other end of 2nd rope to burn, which takes exactly 15 minutes to burn

- mdj February 04, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

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

- Holger July 18, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Great!

- cts.akshay August 19, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote
- Vishal S Kumar February 04, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

count 60 for fifteen time , and take out the boiled egg :)

- vivek rathi March 17, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

floding the rope equally twice, start burning one side

- James September 03, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

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.

- Akshay August 19, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

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!

- cts.akshay August 19, 2015 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

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.

- JayJay February 22, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

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 :-)

- Chris Kamper March 12, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

i appretiate the logic but


no guarrenty to take xact 15 min for whole rope to burn, due to uneven density.

- Anonymous April 01, 2014 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Ok you are right!

But you can still do it with just one rope:

1. Cut it into two pieces and light both ends of each piece.
2. When only one of the pieces is left, cut it again and immediately light the cut ends.
3. Repeat 2. until nothing is left..

- Correction September 29, 2014 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More