• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to secondary sidebar

GoHired

Interview Questions asked in Google, Microsoft, Amazon

Join WeekEnd Online Batch from 4-April-2020 on How to Crack Coding Interview in Just 10 Weeks : Fees just 20,000 INR

  • Home
  • Best Java Books
  • Algorithm
  • Internship
  • Certificates
  • About Us
  • Contact Us
  • Privacy Policy
  • Array
  • Stack
  • Queue
  • LinkedList
  • DP
  • Strings
  • Tree
  • Mathametical
  • Puzzles
  • Graph

25 horses 5 tracks Find 3 fastest puzzle

June 10, 2014 by Dhaval Dave

Suppose 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 in a race because there are only 5 tracks. What is the minimum number of races required to find the 3 fastest horses without using a stopwatch?

Answer : Its very interesting and easy looking puzzle.
First solution that people think :
-> have 5 races, u’ll have top 5 winner in each race,
-> have 1 race between this top 5 and get top 3.

But think
say there are 25 horses in 5 races and their time (though we don’t have stopwatch just imagine if we have then what can be missing case in above solution)
where a1,b1.. are fastest among a(i), b(i) etc
a1,a2,a3,a4,a5   Time taken : 1 , 1.30 , 2 , 2.05 , 2.50
b1,b2,b3,b4,b5  Time taken : 0.95 , 0.98 , 0.99 , 1.05 , 1.50
c1,c2,c3,c4,c5   …..
d1,d2,d3,d4,d5  …..
e1,e2,e3,e4,e5  …..
here as above written solution if we go then we can see that b2, b3 are faster then a1 but above solution does not allow them to race.
So Get Real solution.

Have visual representation

a1 a2 a3 a4 a5
b1 b2 b3 b4 b5
c1 c2 c3 c4 c5
d1 d2 d3 d4 d5
e1 e2 e3 e4 e5

In each row, the fastest horses are listed in descending order, from the fastest (extreme left) to the slowest (extreme right).so in the first race a1 was the fastest and a5 was the slowest. In the second race b1 was the fastest, b2 was the second fastest and so on.

Next :
we’ve had 5 different races, we can eliminate the slowest 2 horses in each group since those horses are definitely not in the top 3 . so we have now matrix as a1,a2,a3 ..to.. e1,e2,e3.

Next :
we can have 6th race with a1, b1, c1, d1, e1 so that we can have fast 3 .
(Why to do so..
the horse say e1 and d1 came 4th and 5th are not fastest 3 but together we can eliminate d2,d3 and e2,e3 as they are also slower than d1 and  e1 and so they are slower then a1,b1,c1 )

Hence finally we have
a1 , a2 , a3
b1 , b2 , b3
c1 , c2 , c3

Now as a1 is the fastest among fastest, we can say the first fastest is a1 . and we don’t need to keep a1 in race to get second and third fastest.

we have
a2, a3
b1 , b2 , b3
c1 , c2 , c3

Which horses still we can eliminate from sixth race.
a1 is fastest, for second and third position b1,c1, b2 can only be possible candidate.
as b3 is slowest in b1,b2,b3 so it can’t take 2nd, or 3rd fastest. similarly c3 can’t be in 2nd and 3rd fastest.
Now as c2 is slower then c1 and c1 is slower then b1. (in sixth race a1 was first, b1 was second, and c1 was third)
hence c2 also can’t be in 2nd and 3rd fastest.

Finally we have

a2, a3
b1 , b2
c1.

Have 7th race among this 5 horse . get fastest two
say b1 and a2. (or any)

We have top three fastest a1,b1,a2.

Similar Articles

Filed Under: Interview Questions, Puzzle Tagged With: Puzzle

Reader Interactions

Primary Sidebar

Join WeekEnd Online/Offline Batch from 4-April-2020 on How to Crack Coding Interview in Just 10 Weeks : Fees just 20,000 INR

Join WeekEnd Online/Offline Batch from 4-April-2020

WhatsApp us

Secondary Sidebar

Custom Search

  • How I cracked AMAZON
  • LeetCode
  • Adobe
  • Amazon
  • Facebook
  • Microsoft
  • Hacker Earth
  • CSE Interview

Top Rated Questions

Printing each word reverse in string

N teams are participating. each team plays twice with all other teams. Some of them will go to the semi final. Find Minimum and Maximum number of matches that a team has to win to qualify for finals ?

Common Ancestor in a Binary Tree or Binary Search Tree

Calculate price of parking from parking start end time prices

Closed Parentheses checker

CodeChef’ RRCOPY

Edit Distance ( Dynamic Programming )

Implement a generic binary search algorithm for Integer Double String etc

Find an index i such that Arr [i] = i in array of n distinct integers sorted in ascending order.

Maximum difference between two elements s.t larger element appears after the smaller number

Given a float number convert it into the string WITHOUT using any inbuilt Function

write a c program that given a set a of n numbers and another number x determines whether or not there exist two elements in s whose sum is exactly x

N Petrol bunks or City arranged in circle. You have Fuel and distance between petrol bunks. Is it possible to find starting point so that we can travel all Petrol Bunks

Given a string, find the first character which is non-repetitive

Find if a binary tree is height balanced ?

BFS (Breath First Search)

Find the element that appears once others appears thrice

Get Minimum element in O(1) from input numbers or Stack

Find next greater number with same set of digits

Flipkart SDET Interview Experience

Apriori algorithm C Code Data Mining

Circular Linked List

Find if two rectangles overlap

Memory Efficient LinkedList

Longest Increasing Subsequence

Stock Buy Sell to Maximize Profit

Maximum occurred Smallest integer in n ranges

Stickler thief

C++ OOPs Part2

Flipkart Set 1 On Campus with Answers

Copyright © 2025 · Genesis Framework · WordPress · Log in