Software Developers Interview Questions

96,323 software developers interview questions shared by candidates

You have 25 horses, and you want to know which are the top 3 fastest, but you don't have a stopwatch. You can race the horses, but the track is only big enough to fit 5 horses at a time. How do you find the first, second and third fastest horses using the least amount of races possible?
avatar

Financial Software Developer

Interviewed at Bloomberg

4
Jan 30, 2010

You have 25 horses, and you want to know which are the top 3 fastest, but you don't have a stopwatch. You can race the horses, but the track is only big enough to fit 5 horses at a time. How do you find the first, second and third fastest horses using the least amount of races possible?

Problem Statement : 18 Ralway Stations from Tamil Nadu are given. A passenger need ticket. Upto the 5 stations journey, fare is 10 Rs. After the 5 stations, for every 5 stations, 5 Rs extra will be charged. For the full stretch journey i.e. From 1st to the last station, fare is 20 Rs. Input 1 : StationFrom - Guindy, StationTo - Kadambakkam Output 1 : Print ticket. i.e. StationFrom : Guindy, StationTo : Kadambakkam, Total Stops : 3, Total Fare : 10 Input 2 : StationFrom - Guindy , StationTo - Chennai Fort Output 2 : Print ticket. i.e. StationFrom : Guindy, StationTo : Chennai Fort, Total Stops : 8, Total Fare :15 Code should follow design principles, patterns. Test Driven Development would be preferable, not mandatory though.
avatar

Software Developer

Interviewed at Thoughtworks

4
Aug 28, 2015

Problem Statement : 18 Ralway Stations from Tamil Nadu are given. A passenger need ticket. Upto the 5 stations journey, fare is 10 Rs. After the 5 stations, for every 5 stations, 5 Rs extra will be charged. For the full stretch journey i.e. From 1st to the last station, fare is 20 Rs. Input 1 : StationFrom - Guindy, StationTo - Kadambakkam Output 1 : Print ticket. i.e. StationFrom : Guindy, StationTo : Kadambakkam, Total Stops : 3, Total Fare : 10 Input 2 : StationFrom - Guindy , StationTo - Chennai Fort Output 2 : Print ticket. i.e. StationFrom : Guindy, StationTo : Chennai Fort, Total Stops : 8, Total Fare :15 Code should follow design principles, patterns. Test Driven Development would be preferable, not mandatory though.

Viewing 161 - 170 interview questions

Glassdoor has 96,323 interview questions and reports from Software developers interviews. Prepare for your interview. Get hired. Love your job.