Comments on: Fastest horse Interview question https://demo.ritambhara.in/fastest-horse-interview-question/ Coding / System Design Interviews Tue, 30 Jun 2015 08:18:20 +0000 hourly 1 https://wordpress.org/?v=6.7.2 By: Kamal Rawat https://demo.ritambhara.in/fastest-horse-interview-question/#comment-1979 Tue, 30 Jun 2015 08:18:20 +0000 http://www.ritambhara.in/?p=2855#comment-1979 You mean to say that the 2nd horse from the group of 2'nd fastest horse (because the third horse from this group can only come at 4'th position – at least the fastest is at top)
This horse (which came 2nd in first round of 2'nd fastest horse) is being taken care of while considering the 3rd position.

]]>
By: Kamal Rawat https://demo.ritambhara.in/fastest-horse-interview-question/#comment-1978 Tue, 30 Jun 2015 08:16:11 +0000 http://www.ritambhara.in/?p=2855#comment-1978 I think these cases are being taken care of:
1. While finding the 2nd fastest horse we consider the horse that came 2nd in first round of race involving the fastest horse. While finding the 3rd fastest horse we consider the horse that came 3rd in the first round of race involving the fastest horse.
2. All top horses from each group actually move to 6'th race. So they are all taken care of.
3. A) In this case 3rd horse has to be the one which came 2nd in the 6'th race.Hence being taken care of.
3. B) In this case 2nd horse has to be the one which came 2nd in the 6'th race (because he has beaten the toppers from each group).Hence being taken care of.
3. C) In this case the 2nd horse is the one which came 2nd in the 6'th race. and we did consider the horse defeated by this horse in the first round/
I think, the cases that you were enumerating over phone are all taken care of.. or is there anything that is left ?

]]>
By: Manoj Ghangas https://demo.ritambhara.in/fastest-horse-interview-question/#comment-1977 Mon, 29 Jun 2015 17:18:52 +0000 http://www.ritambhara.in/?p=2855#comment-1977 We need to cater to below 3 Scenarios for the optimal solution:
1. All top 3 horses are from same group
2. All are from different groups
3. 2 are from one group and they can be:
A) 1st and 2nd from same group
B) 1st and 3rd from same group
C) 2nd and 3rd from same group

]]>
By: Manoj Ghangas https://demo.ritambhara.in/fastest-horse-interview-question/#comment-1976 Mon, 29 Jun 2015 14:25:28 +0000 http://www.ritambhara.in/?p=2855#comment-1976 I don't have optimal solution right now but I see flaw in the optimal solution; what if 3rd horse from 2nd fastest horse's group is faster than fastest horse's 2nd horse?

]]>