# The 25 Horses Puzzle: Find the Top 3 in 7 Races

Source: https://www.techinterview.org/post/3233475416/25-horses-puzzle-top-3-seven-races/
Updated: 2026-07-26 · techinterview.org

**TL;DR —** You need 7 races to guarantee the three fastest of 25 horses when you can only race 5 at a time and have no stopwatch. Run 5 races to rank each group of five, a 6th race among the five group winners to identify the overall fastest, then a 7th race with the only five remaining contenders: the 2nd and 3rd horses from the winning group, the top two from the second group, and the winner of the third group. The first two finishers of that final race are 2nd and 3rd overall.

You have **25 horses** and you want to find the **three fastest**. You have a racetrack with **5 lanes**, so you can race 5 horses at a time and see their finishing order. There is **no stopwatch** — you only learn the *relative* order of the horses in each race, not their times. Horses run consistently (a horse's speed never changes from race to race).

**What is the minimum number of races you need to guarantee you've found the top 3, in order?**

This one shows up constantly at [Google](https://www.techinterview.org/companies/), and it's a favorite at [quant firms](https://www.techinterview.org/quant-firm-interview-guides/) like Jane Street and Citadel. It's a great puzzle because the "obvious" answer is wrong in a way that's easy to talk yourself into, and the real answer requires you to notice which horses you can *eliminate without racing them again*. The no-stopwatch rule is the whole trick — if you had a timer, you'd just run 5 races, record times, and sort. Take a minute before revealing the strategy.

## Related reading

- [Are You Allowed to Use AI in Coding Interviews? The 2026 Rules](https://www.techinterview.org/post/3233475415/ai-coding-interviews-rules-2026/)

- [What Actually Changed in Tech Interviews in 2026](https://www.techinterview.org/post/3233475417/what-changed-tech-interviews-2026/)

- [The Behavioral Interview & Salary Negotiation Playbook (With Real Scripts)](https://www.techinterview.org/post/3233475418/behavioral-interview-negotiation-playbook/)

- [Browse all interview problems](https://www.techinterview.org/problem-index/)

- [Building a Stack with a getMax() Function](https://www.techinterview.org/post/3233459129/building-a-stack-with-a-getmax-function/)
