Interview Questions

Four people need to cross a rickety rope bridge to get back to their camp at night.....

Microsoft Interview Questions and Answers


(Continued from previous question...)

12. Four people need to cross a rickety rope bridge to get back to their camp at night.....

Question:
Four people need to cross a rickety rope bridge to get back to their camp at night. Unfortunately, they only have one flashlight and it only has enough light left for seventeen minutes. The bridge is too dangerous to cross without a flashlight, and it’s only strong enough to support two people at any given time. Each of the campers walks at a different speed. One can cross the bridge in 1 minute, another in 2 minutes, the third in 5 minutes, and the slow poke takes 10 minutes to cross. How do the campers make it across in 17 minutes?


maybe an answer:

answer1:
Let’s name the as A,B,C & D and let’s assume that they take 1,2,5 and 10 minutes respectively. Here is how they should cross the bridge.

ABCD |—————————–|
CD |——-AB(2min)————->|
CD || BCD
A || ABCD
If you count all the trips ie. 2+1+10+2+2, it will be 17 minutes

answer2:
– 1, 2, 5, 10
1, 2 — 5, 10
2 — 1, 5, 10
2, 5, 10 — 1
5, 10 — 1, 2
1, 2, 5, 10 –


answer3:
A(1), B(2), C(5), D(10)

1. A & B cross together. They take 2 minutes
2. A come back to start point. He takes 1 more min.
3. So far 3 minutes invested in total
4. C and D start together. Reach in 10 minutes. So total 13 minutes invested so far
5. B who is at the far end, take the torch and comes back to start point. He needs 2 min
6. So far far 15 min invested
7. A and B start together, reach the far end in 2 min
8. Total 17 min invested.


answer4:
Its easy…..
a:-1 min
b:-2 mins
c:-5 mins
d:-10 mins

Ist Pass :- a,b–> takes 2 mins for inbound crossing and 1 min for a outbound leaving b at the other end
Total mins for Inbound and outbound :-
inbound trip :-2 mins
outbound trip:-1 min
———————
total :- 3 mins
————————–
2nd Pass :- c,d–> takes 10 mins for inbound crossing and 2 min for a outbound leaving both c,d at the other end and getting back b.
Total mins for Inbound and outbound :-
inbound trip :-10 mins
outbound trip:-2 min
———————
total :- 12 mins
————————–
3rd Pass :- a,b–> takes 2 mins for inbound crossing and no outbound trip
Total mins for Inbound and outbound :-
inbound trip :-2 mins
outbound trip:-0 min
———————
total :- 2 mins
————————–

got it !!!…..12+3+2=17mins


answer5:
A(1), B(2), C(5), D(10)

1. A & B cross together. They take 2 minutes
2. A come back to start point. He takes 1 more min.
3. So far 3 minutes invested in total
4. C and D start together. Reach in 10 minutes. So total 13 minutes invested so far
5. B who is at the far end, take the torch and comes back to start point. He needs 2 min
6. So far far 15 min invested
7. A and B start together, reach the far end in 2 min
8. Total 17 min invested.


answer6:
trying to address the flashlight problem as well since it is dangerous to cross without the flashlight.

1. D(10 min) and C(5 Min) will start walking. D will hold the flash light.

2. By the time D will get to the middle, C will get off the bridge. Total Time So Far = 5 min

3. B will get on the bridge, D stays at middle of the bridge, helping B with Flash light untill B cross the bridge. Total Time (5 + 2 min of B) = 7 Min

4. A will get on the bridge, D still stays at middle of the bridge, Helping A with flash light untill A cross the bridge. Total Time (5 + 2 (B) + 1 (A)) = 9 min.

5. D will start walking and will be off the bridge in 5 min since he was at Halfway already. Total Time ( 5 + 2 + 1 + 5 ) = 13 min.

answer6:
For 1, 2, 5, 10, the 1 and 2 are the fast walkers, so we want to have one of them at both ends to pass the flash light back. The 5 and 10 are slow walkers, so we want to have them walker together and not walk the return path. Therefore the logic is:

step 1). 1 and 2 walk together, and 1 walk back alone to return flash light => 2 + 1 = 3 minutes.

step 2). 5 and 10 walk togther, and have 2 walk back alone to return flash light => 3 + (10 + 2) = 15 step 3). 1 and walk together again => 15 + 2 = 17.

(Continued on next question...)

Other Interview Questions