Google Interview: 25 Horses
The 25 Horses Puzzle is a popular question that has been used by Google and other tech companies in interviews to evaluate a candidate’s ability to solve problems. It involves no code, but is a good test of logic and association. Here’s the question:
Let’s say that you have 25 horses, and you want to pick the fastest 3 horses out of those 25. In each race, only 5 horses can run at the same time because there are only 5 tracks. What is the minimum number of races required to find the 3 fastest horses without using a stopwatch?
For the sake of clarity, let’s assume that each horse’s speed doesn’t change regardless of race conditions, fatigue or good ol’ fashioned determination.
Sorry, Seabiscuit.
Some have suggested considering the horses as mechanical, and programmed to run the same speed each time they race. Whatever you choose to believe, the horses will come in the same place every race. You can never know their times, only what place they finish in. How many races will it take to find the top three horses? Let’s get into it.