Software Developer Intern Interview Questions

2,878 software developer intern interview questions shared by candidates

In this problem, four people need to cross a river at night, but they have only one torch, and at most two people can cross at a time. The torch is required for any crossing, meaning someone must always bring it back if others are still waiting. Each person takes a different amount of time to cross the river: Person A takes 1 minute, Person B takes 2 minutes, Person C takes 5 minutes, and Person D takes 10 minutes. When two people cross together, they must go at the pace of the slower person. The challenge is to figure out how all four people can get across the river in 17 minutes or less.
avatar

Software Developer Intern

Interviewed at SOTI

3
Jul 19, 2025

In this problem, four people need to cross a river at night, but they have only one torch, and at most two people can cross at a time. The torch is required for any crossing, meaning someone must always bring it back if others are still waiting. Each person takes a different amount of time to cross the river: Person A takes 1 minute, Person B takes 2 minutes, Person C takes 5 minutes, and Person D takes 10 minutes. When two people cross together, they must go at the pace of the slower person. The challenge is to figure out how all four people can get across the river in 17 minutes or less.

Viewing 2271 - 2280 interview questions

Glassdoor has 2,878 interview questions and reports from Software developer intern interviews. Prepare for your interview. Get hired. Love your job.