The horse race puzzle is a classic interview puzzle asked by many tech companies . The puzzle is like this
Puzzle : There are 25 horses among which you need to find out the fastest 3 horses. You can conduct race among at most 5 horses in a single race to find out their relative speed. At no point you can find out the actual speed of the horse in a race. Find out minimum number of races are required to find the 3 horses.
Scratch your brain a bit before viewing the solution .
Solution : The answer is 7 .Here’s how :
Divide the horses into group of 5 (A,B,C,D,E) and conduct 5 races to find 5 fastest horses .
Now conduct a race among these to find the fastest horse (Let’s say it’s from group E) .and let’s also assume that fastest horse from group D came 2nd and C came 3rd. Total 6 races done. Now the second fastest horse can be the one who came second in the group E which gave us the fastest horse or the one which came second in 6th race. Similarly the 3rd fastest horse can be
the either fastest horse from group D and C ,or the horses which came 2nd and 3rd in group E or the horse which came second in group D. Conduct a race among these 5 horses and you will get the result in final and 7th race.
Have got some interview questions submit it here.So that we can help other candidates like you to land their dream job