Work in HR or Recruiting?
Goldman Sachs
www.goldmansachs.com New York, NY 5000+ Employees
Work in HR? Complete Your Profile

336 interview experiences Back to all Goldman Sachs Interview Questions & Reviews

Interview Question for Software Engineer Intern at Goldman Sachs:
Jul 28, 2009

1 of 1 people found this helpful

Suppose you had eight identical balls. One of them is slightly heavier and you are given a balance scale . What's the fewest number of times you have to use the scale to find the heavier ball?


Tags: brain teaser
Add Tags [?]

See more for this Goldman Sachs Software Engineer Intern Interview

Helpful Question?  
Yes | No
Inappropriate?

Answers & Comments (30)

2 of 12 people found this helpful

Jul 29, 2009

by Brian:

3 times. (2^3 = 8)
Helpful Answer?  
Yes | No
Inappropriate?

25 of 28 people found this helpful

Jul 29, 2009

by Marty:

Two. Split into three groups of three, three, and two. weigh the two groups of three against each other. If equal, weigh the group of two to find the heavier. If one group of three is heavier pick two of the three and compare them to find the heaviest.
Helpful Answer?  
Yes | No
Inappropriate?

4 of 5 people found this helpful

Jul 29, 2009

by Bill:

Brian - this would be correct if you in fact were using a weighing scale, and not a balance scale. The ability to weigh one group against another with a balance scale allows Marty's answer to be a correct answer.

Although - the question as worded provides a loophole. If it had been worded as "What's the fewest number of times you have to use the scale to CONSISTENTLY find the heavier ball", then Marty's answer would be the only correct answer.

However, it is possible that you could get lucky and find the heavier ball in the first comparison. Therefore, the answer to the question as stated, is ONE.
Helpful Answer?  
Yes | No
Inappropriate?

2 of 3 people found this helpful

Jul 30, 2009

by VK:

This question is from the book "How to move Mt Fuji".... Marty has already got the right answer.
Helpful Answer?  
Yes | No
Inappropriate?

0 of 4 people found this helpful

Jul 31, 2009

by woctaog:

Actually Bill, by your interpretation of the question the answer is zero, because you could just pick a ball at random. If you get lucky, then you've found the heaviest ball without using the scale at all, thus the least possible amount of times using the scale would be zero.
Helpful Answer?  
Yes | No
Inappropriate?

1 of 2 people found this helpful

Jul 31, 2009

by whizkid:

The answer is 2, as @Marty mentioned. cuz its the worst case scenario which u have to consider, otherwise as @woctaog mentioned it can be zero, u just got lucky picking the first ball....
Helpful Answer?  
Yes | No
Inappropriate?

0 of 6 people found this helpful

Jul 31, 2009

by Amy:

None- weigh them in your hands.
Helpful Answer?  
Yes | No
Inappropriate?

0 of 6 people found this helpful

Aug 02, 2009

by Aly:

Assuming that the balls cannot be discerned by physical touch, the answer is 3.
You first divide the balls in two groups of 4, weigh, and discard the lighter pile. You do the same with the 4 remaining, dividing into two groups of 2, weighing, and discarding the lighter pile. Then you weigh the two remaining balls, and the heavier one is evident.
Helpful Answer?  
Yes | No
Inappropriate?

5 of 6 people found this helpful

Aug 04, 2009

by le-impresario:

2

3a+3b+2 = 8
if wt(3a)==wt(3b) then compare the remaining 2 to find the heaviest
if wt(3a) !== wt(3b) then
    ignore group of 2
   discard lighter group of 3
   divide the remaining group of 3 into 2+1
   weigh those 2
     If == the remaing 1 is the heaviest
    if !== the heaviest will be on the scale
Helpful Answer?  
Yes | No
Inappropriate?

0 of 3 people found this helpful

Aug 05, 2009

by jimwilliams57:

With the systematic approach, the answer is 3.

But, if you randomly choose 2 balls and weigh them, and by coincidence one of these two is the heavier ball, then the fewest number of times you'd have to use the scale is 1.

Although the real question is: are the balls truly identical if one is heavier than the rest?
Helpful Answer?  
Yes | No
Inappropriate?

0 of 3 people found this helpful

Aug 05, 2009

by fewest possible times using the scale:

just once. Say you are lucky and pick the heavy ball. One use of the scale will reveal your lucky choice
Helpful Answer?  
Yes | No
Inappropriate?

0 of 2 people found this helpful

Aug 05, 2009

by most answers seem to calculate the expected (average) number of times.:

so once, or the creative answer zero if you allow for weighing by hand
Helpful Answer?  
Yes | No
Inappropriate?

Aug 06, 2009

by Derek:

Without judging by hand: Put 4 balls on one side, and 4 on the other. Take the heavier group and divide again, put 2 balls on one side, and 2 on the other. Take the 2 that were heavier, and put one on each side. You've now found the heaviest ball. This is using the scale 3 times, and will always find the right ball.
Helpful Answer?  
Yes | No
Inappropriate?

0 of 1 people found this helpful

Aug 06, 2009

by HSS:

None. They are identical. None is heavier.
Helpful Answer?  
Yes | No
Inappropriate?

4 of 4 people found this helpful

Aug 06, 2009

by dutchmobil:

2 weighings to find the slightly heavier ball.

Step 1.
compare 2 groups of three balls.

Case 1.
if they are both equal in weight, compare the last 2 balls - one will be heavier.

case 2.
If either group of 3 balls is heavier, take 2 balls from the heavier side.
compare 1 ball against the 2nd from the heavy group
result 1. if one ball is heavier than the other, you have found the slightly heavier ball.
result 2. if both balls are equal weight, the 3rd ball is the slightly heavier ball.

Easy Shmeezi
Helpful Answer?  
Yes | No
Inappropriate?

Aug 06, 2009

by erich:

Fewest - get lucky and pick the heaviest one. But wait! How would you know it is the heaviest one by just weighing one ball? Your logic is flawed.

Two groups of four. Split heavier one, weigh. Split heavier one, weigh. 3 times.
Helpful Answer?  
Yes | No
Inappropriate?

0 of 2 people found this helpful

Aug 08, 2009

by Nishat Chowdhury:

i think its 3. i would take it like this
OOOO OOOO then
OO OO
then
OO

problem solved. i do this everyday. bye. praise be to allah. thats it.
Helpful Answer?  
Yes | No
Inappropriate?

0 of 1 people found this helpful

Aug 09, 2009

by Anonymous:

It's 2. Period.

If you can't figure it out look it up online or in "How Would You Move Mount Fuji" (like somebody else said). This is one of the most basic brainteasers you could be asked in an interview.
Helpful Answer?  
Yes | No
Inappropriate?

3 of 3 people found this helpful

Aug 09, 2009

by Kevin:

The answer is 2.

1) Divide the balls into 3 groups. 2 piles with 3 balls each, 1 pile with 2 balls.
2) Weigh the 2 piles of 3 balls. If both piles are the same weight, discard all 6 and weigh the last 2 to find the heavier one.
3) If 1 pile of 3 is heavier than the other, discard the lighter pile and the pile of 2 balls. Weigh 2 of the remaining 3 balls from the heavier pile. If both of the weighed balls are equal, the last ball is the heavier one.
Helpful Answer?  
Yes | No
Inappropriate?

0 of 1 people found this helpful

Aug 17, 2009

by Wanda:

2=if all the balls are identical and you pick up the first...weigh it and the second one is lighter or heavier then you've found the heavier ball in the least amount of attempts.
Helpful Answer?  
Yes | No
Inappropriate?

0 of 1 people found this helpful

Aug 17, 2009

by Wanda:

1=if all the balls are identical and you pick up the first...balance it and the second one is lighter or heavier then you've found the heavier ball in the least amount of attempts.
Helpful Answer?  
Yes | No
Inappropriate?

Aug 19, 2009

by Steve:

Amy is 100% correct for the following reason:

everyone (except Amy) is solving the theoretical problem. The practical side of the problem - notwithstanding jimwilliams57's brilliant observation that if one weighs more than the others IT IS NOT IDENTICAL (would have loved to see the interviewer's face on that one) - in order to 'weigh' them on a scale, one has to pick them up, therefore, you will immediately detect the heavier one without weighing: pick-up three and three ... no difference, no need to weight. Pick-up the remaining two to determine the heavier one.

Steve
Helpful Answer?  
Yes | No
Inappropriate?

Aug 21, 2009

by John:

First off, take yourself through the process visually and forget square roots, that doesnt apply here and here is why: The question is the Minimum, not the MAXIMUM. BTW, the max would be 7 ( 8-1); you are comparing 2 objects, so 1 ball is eliminated automatically in the first step. Anyway, you have a fulcrom of which you are placing 2 of 8 objects on each end. If by chance you pick the slightly heavier object as one of the two balls, you have in fact, found the slightly heavier one in the first round... btw dont be a smartass with your interviewer, he is looking for smarts not smarmy;)
Helpful Answer?  
Yes | No
Inappropriate?

Aug 22, 2009

by Morgan Creighton:

Respectfully, the folks who are answering "3" are mathematically modeling the nature of the balance incorrectly. Performing a measurement on a balance scale is not binary. It is trinary. Each measurement gives you one of three responses: The left is heavier, the right is heavier, or they are equal. So while you do need three binary bits to specify a number from one to eight, you need only two TRINARY-DIGITS

Formally, you want the smallest value of n such that 3^n >= 8. The answer is 2. Note that you could add a ninth ball, and still, you'd only need to make two measurements.

Of course, the smarty pants answer would be one. Just pick two balls at random and be lucky to have chosen the heavy one. But you're not guaranteed to be able to do it in just one measurement.
Helpful Answer?  
Yes | No
Inappropriate?

Aug 24, 2009

by Greg:

English isn't my mother tongue... What is a balance scale? If looking up on Google, I find some devices with two bowls on a bar bearing in the center. Hence, the answer is once (if I'm luck enough to select the heavier ball in teh first measurement) If a balance scale allows to measure only one ball at a time, then it would take two measurements, unless you'd have more information on the weight, which is not listed here, hence doesn't exist in the context of the question^.
Helpful Answer?  
Yes | No
Inappropriate?

Aug 25, 2009

by RG emp:

3 times. Not having looked at the other comments, hopefully, I am the 26th to get this right.
Put the balls 4 and 4 on the scale, Take the heavier side and place those balls 2 and 2 on the scale. Take the heavier side and place them 1 and 1 giving the heaviest ball.
Helpful Answer?  
Yes | No
Inappropriate?

Aug 25, 2009

by RG emp:

OK, now I read the comments and see that the people, like the question are divided into to groups, systematic approach people that say 3 (like I did) and analytic people that say 2. It takes a systematic person (me) a minute to get the answer. I'm guessing it took the analytic 5 minutes just to interpret all the ramifications of the question, i.e. they aren't idenitical if..., do it by hand..., get lucky.
Helpful Answer?  
Yes | No
Inappropriate?

Aug 25, 2009

by Brian:

minimum is 1 (if lucky - 25% chance by picking 2 balls at random) & max is 2 (using most efficientl process to absolutely determine without luck - 3/3/2 scenario)
Helpful Answer?  
Yes | No
Inappropriate?

0 of 1 people found this helpful

Aug 25, 2009

by Dash:

While Symantec was busy weighing my balls I took a job with NetApp.... They need to focus on hiring good, capable security engineers, not weighing their balls.
Helpful Answer?  
Yes | No
Inappropriate?

Mar 17, 2010

by PuddinHead:

The point of these interview questions is to both check your logical brain function and to hear how you think. Most of you are just posting jerk off answers trying to be funny, or you are really dumb. These answer get you nowhere with me in an interview. Think out loud, go down the wrong path back track try another logic path, find the answer. None of this "0 if you use your hands". That is fine if you are interviewing for a job in advertising where creativity is desired, nobody wants you writing code like an 8 year old.
Helpful Answer?  
Yes | No
Inappropriate?

To comment on this question, Sign In with Facebook or Sign Up

Goldman Sachs – Why Work for Us?

We bring together people, capital and ideas to produce solutions and results for our clients by playing a number of roles: financial advisor, lender, investor and asset manager. A commitment to integrity, team work and… Full Overview

Provided by employer [?]

Tags are like keywords, helping to categorise interview questions that have something in common.