Bloomberg L.P. Interview Question: three friends with different ... | Glassdoor

Interview Question

Financial Software Developer Interview New York, NY

three friends with different salaries need to find out

  their average salary without revealing individual salaries to each other. how?

Interview Answer

6 Answers


Anonymous on Jan 25, 2011

The answer can simply be that the first guy adds a random number, and after going around the group the first guy himself subtracts it and gives the average. No need to add two other random numbers as stated above

Soham on Aug 4, 2014

Ask a 3rd party to take each dudes salaries and return the average salary.

Benjamin on Aug 4, 2016

One type of solution is to use a physical token system to record the salaries and then average the total. For example they could agree a system of 10gram of rice represents $1000/year then each friend in turn weighs out the rice equivalent of their salary and tips it in into a communal bowl. After all three are done they just need to weigh the total amount of rice and divide by three. Alternatives would be to use pennies, water volume, etc.

Jeremy on Apr 23, 2017

Person A splits his salary into two unequal parts, A1+A2, choosing any split he likes. He tells B what A1 is and C what A2 is. Now B adds his own salary to A1 and tells C the total, B+A1. Then C can add B+A1 to his own salary plus A2 which he received from A, getting the sum of the three salaries, and divide by 3. No randomness needed.

Anonymous on May 2, 2017

person A knows his salary and person B's salary only
and person B knows his salary and person C's salary only
and person C knows his salary and person A's salary only

Person A can say "the sum of my salary and person B's salary is x"
Person B can say "the sum of my salary and person C's salary is y"
Person C can say "the sum of my salary and person A's salary is z"
in other words,
the average will be (x+y+z)/6 because each salary is added twice, so you have to divide by two to counter that, and then divide by three because there are 3 people.

Anonymous on Nov 11, 2017

Add Answers or Comments

To comment on this, Sign In or Sign Up.