# Bridge crossing with torch interview puzzle

Interview Puzzle: There are four persons A, B, C and D who wants to cross a weak bridge in the night. They have one torch with them. Persons A, B, C and D takes 1,2,5 and 8 minutes respectively to cross the complete bridge. At a time, only 2 persons can walk on the bridge.

In what minimum time all persons can cross the bridge and how?

Solution:

Allow 2 faster persons to cross the bridge. So, 1 faster person can get the torch back quickly. and 1 can stay at another end.

Allow 2 slower persons to cross the bride and get the faster person staying at the other end to back.

Allow 2 faster person now to cross the bridge.

This way they can cross in minimum time.

Let’s try this solution:

A and B cross the bridge. – In 2 minutes A and B can cross the bridge.

A comes back in 1 minute leaving B at the other end.

So, for total 2+1= 3 minutes is gone.

Now allow slower persons i.e. C and D that takes 5 and 8 minutes respectively to cross the bridge. Both will take 8 minutes to cross the bridge.

So for, 3+8 =11 minutes gone.

Leaving C and D to other side, B will come back in 2 minutes.

So, for total time spend = 11+2 = 13 minutes

Finally, A and B will cross in 2 minutes. Now, all four persons are at the other end.

So, Total minimum time taken = 13+2= 15 minutes