Bloomberg LP Interview Question for Financial Software Developers






Comment hidden because of low score. Click to expand.
4
of 4 vote

Nicely explained Jaggs,
just to put little more clarity…

Split the horses into 5 groups and race each of the 5 groups (5 races). After that, you have the horse placements for each group. I laid it out like this:

A B C D E
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
5 5 5 5 5

Five columns, one for each group of horses, lettered A-E. Each number represents a horse... say horse A1 is the one that came in first place from group A, C2 is the horse that placed 2nd in group C, and so on.

You can eliminate all 4's and 5's from the chart, since we know that there are at least 3 horses that are faster for each 4th and 5th place horse.

A B C D E
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3

Now race all the 1's (race #6). This will give you the fastest horse from the initial 25. But what about 2nd and 3rd place?

Let's say A1 got 1st, B1 got 2nd, C1 got 3rd, D1 got 4th and E1 placed last in race #6. A1 is definitely the fastest horse, but B1 may or may not be. Horse A2 can still be faster than B1- we have never raced them together before.

Approach it this way: which horses can we eliminate? Find all horses that we know have at least 3 horses faster than them. We can eliminate D1 and E1, because we know that A1, B1, and C1 are all faster than them. We can also eliminate all other horses in columns D and E below them. We can't eliminate C1, but we can eliminate C2 and C3. We also eliminate B3, since B2, B1, and A1 were all proven to be faster.

A B C D E
1* 1 1
2 2
3

The only horses left to race are A2, A3, B1, B2, and C1. (Race #7). The 2nd and 3rd place finishers are then 2nd and 3rd fastest from the original 25.

- initrd February 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Very nicely explained

- abhimanipal February 21, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

nice one bro !!

- sachin323 March 11, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

///The only horses left to race are A2, A3, B1, B2, and C1. (Race #7). The 2nd and 3rd place finishers are then 2nd and 3rd fastest from the original 25. ///


shouldn't it be the 1st and 2nd of this race are the 2nd and 3rd of 25 >??

- confused March 22, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@initrd: Right answer and very nice explanation

- Bandicoot March 28, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

nice explanation :)

- csegau April 18, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

How can you eliminate C2? It can be faster than B2 as we never had a race between them. Can you please explain?

- Chetan May 27, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

We can eliminate C2 'safely' since C2 < C1 < B1 < A1 (possible top 3).

- futurus August 22, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

nicely explained~~~

- sharonluo February 05, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

You can easily do it in 7 races.
step1: 5 races one each for 5 different horses. (5)
pick the top from each Q. (so 5 queues)
step2: eliminate the 4th and 5th horse and the succesors in their queue ( you are left with 15 horses. only 3 queues). Also you can eliminate the 4th and 5th horse from each of the remaining 3 queues. Also the second and third from 3rd queue and the third from the 2nd Q.
further the one that stood first is obviously the best. Move him out for further considerations.
you are left with only 5 horses.
step3: one more race required.
Ans shall be 6. Please comment if i am missing something .

- hary February 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

incorrectly quoted ans as 7

- hary February 15, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I got 7 as the answer as well. Are you sure it's 6?

Here are my steps:

1) 5 races because 1 for each pool of 5
2) 1 race for all the winners in step 1
3) now you know the "superwinner" (guy who placed first in steps 1 and 2), so race the 2nd/3rd place horses in step 2 vs the 2-4th place horses from the superwinner's group

total is 7 races.

What did I miss?

- Vince February 15, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

My bad i dont know what i have been thinking all about. Sprry for all confusion its 7 only.

- hary February 16, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

7 is the right answer...

- Anonymous February 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

great!

- nagabhushana.s July 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

what happens when all top 3 horses are in same pool?

- tetura February 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

It works even then. I mean the explaination and answer takes care of all possible combinations. Try urself on a piece of paper, i am sure you will not have problems

- 123 February 17, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

It works even then. I mean the explaination and answer takes care of all possible combinations. Try urself on a piece of paper, i am sure you will not have problems

- 123 February 17, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

does not work when all the top 3 are in the same pool in the first iteration..we would be letting down the 2nd and 3rd ones right away...if thats not the case, i'm missing something from the initial explanation...can someone please elaborate?

- Anonymous February 17, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The answer is into maintain relations ships i.e rule out every horse that has at least 3 horses faster than him

Check it as ... Divide horses into 5 groups and race them

A 1 2 3 4 5
B 1 2 3 4 5
C 1 2 3 4 5
D 1 2 3 4 5
E 1 2 3 4 5

Now race all groups, you will get winners from all groups, and the following relationship would hold

A 1> 2> 3> 4> 5
B 1> 2> 3> 4> 5
C 1> 2> 3> 4> 5
D 1> 2> 3> 4> 5
E 1> 2> 3> 4> 5

please read 4>5 as 4th horse is faster than 5th

Now get horses from every group who stood first and race them
Lets suppose we have the following out put

A1 > B1 > C1 > D1 > E1

Now we can

Eliminate E1 we know that there are 4 horses faster than him
Eliminate E2, E3, E4, E5 as all of them are slower than E1
Eliminate D1 we know that there are 3 horses faster than him
Eliminate D2, D3, D4, D5 as all of them are slower than D1
Eliminate A1, he is the fastest
Eliminate B3 as B1, B2 and A1 are faster than him
Eliminate C3 as C2, C1, B1, and A1 are faster than him
Eliminate D3 as D1, D2, C1, B1, and A1 are faster than him
Eliminate E3 as E1, E2, D1, C1, B1, and A1 are faster than him
Eliminate C2 as A1, B1, and C1 are faster than him
Eliminate D2 as A1, B1,D1 and C1 are faster than him
Eliminate E2 as A1, B1,C1,D1 and E1 are faster than him
Now u r left with 4 horses, race them to find out the 2nd and 3rd position

so total number of races is 7

- Jaggs February 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think right answer is 11 races minimum.

race#1 : 3/5
race#2 : take 3 winning horses from prev race and add 2 new
.
.
race#11:

--You cannot split horses in 5 different groups because top 3 horses could be in the same group.
--To make sure you get top 3/25, top 3 of "n" race should go to "n+1" race.

- Rakesh February 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Did you even read the solution?

- Anonymous March 05, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

{LOL!!!}

- Anonymous September 12, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Dude..solution is right above u

- tonny October 14, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

11 is the correct answer

- Sourav December 03, 2014 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More