Bloomberg LP Interview Question for Financial Software Developers






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

#1.break the coins into 3,3 and 1
#2. balance 3 and 3 (if they are equal weight then the single coin you didnt balance is the heavier coin)
else
#3. take the the side of the balance which is heavier and break it again in 1,1 and 1(discard the lighter side coins and the remaining one coin)
#4. balance again 1 and 1 each, if they are equal then the one you are holding is heavier or the one which is showing on the balance as heavier is heavier

- Tejaswi February 03, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

@Tejaswl
The question is not about which coin is heavier, but it's which coin is different, The unusual coin may be lighter also.. Your algo is not taking this into consideration.....

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

are we given a "balancing scale" or just a "weighing scale"??? some reason financial companies are fond of "Coins" with incomplete questions. :D

- GekkoGordan February 04, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Tejaswi has the right approach. This is one of the most repeated brain teasers

- DDDDDDDDDDDDDDDDDDDDDDDDDD February 07, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

break it into 2,2,3
1. balance 2 and 2.
if 2=2 then goto "For 3 coins";
if 2=!2 then goto "For 4 coins";

For 3 coins:
2. balance A and B.
if A=B, then return C.
if A=!B, then do step 2.
3. balance A and C.
if A=C, return B.
if A=!C, return C.

For 4 coins:
2.Balance A and B. 3.Balance A and C.
if A=B
if A=C, then return D.
if A=!C, then return C.
if A=!B
if A=c, then return B.
if A=!c, then return A

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

break it into 2,2,3
1. balance 2 and 2.
if 2=2 then goto "For 3 coins";
if 2=!2 then goto "For 4 coins";

For 3 coins:
2. balance A and B.
if A=B, then return C.
if A=!B, then do step 3.
3. balance A and C.
if A=C, return B.
if A=!C, return C.

For 4 coins:
2.Balance A and B. 3.Balance A and C.
if A=B
----if A=C, then return D.
----if A=!C, then return C.
if A=!B
----if A=c, then return B.
----if A=!c, then return A

- Kai February 16, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

This exceeds the given constraint of 2 chances..

- Anonymous March 22, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

nice

- Anonymous March 08, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I don't think it is possible in just 2 weighings

- Anonymous March 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I can do it in 3 to find which is different.

- wei sheng April 27, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I can do it in 3 to find which is different.

- wei sheng April 27, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

not possible in 2 weighings unless told lighter or heavier

- vm December 30, 2012 | 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