The correct answer is 31 minutes. This is a very common puzzle question which has been included in various books on brain-teasers, and a few mini games are also based on this puzzle.
The basic trick here is that 1, being the fastest, should ideally cross the bridge with each of the others, so that bringing back the lamp will take the least time. However, the important catch here is that the two slowest people(8 and 9) should always cross together, with one of the faster people waiting on the other side to bring the lamp back. This is due to the fact that if they go separately, it will take 8+9 = 17 minutes to cross, plus additional time to bring the lamp back. If they go together, however, it will take only 9 minutes, and even if the next slowest person(6) brings the lamp back, it will only take 9+6 = 15 minutes.
The algorithm for the solution is as follows (One can make minor variations to this without changing the outcome) :
1> 1 and 3 cross, 3 brings back the lamp : 3+3 = 6 minutes.
2> 8 and 9 cross, 1 brings back the lamp : 9+1 = 10 minutes.
3> 1 and 3 cross, 1 brings back the lamp : 3+1 = 4 minutes.
4> 1 and 4 cross, 1 brings back the lamp : 4+1 = 5 minutes.
5> 1 and 6 cross - everyone has reachedthe other side : 6 minutes
Total time = 6 + 10 + 4 + 5 + 6 = 31 minutes
So the basic trick is to make the two slowest people cross only once, together. Cheers!