Tweet |
|
You have eight balls all of the same size. Seven of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier, if you are given a weight balance and only two weightings?
Type: IQ quiz
Source- Software Engineer, Job interview question @ Google
Scroll down to verify your answer.........
...
....
....
....
.....
....
....
....
....
....
....
....
...
...
...
...
...
...
...
...
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
.....
.....
Solution:
Take 6 of the 8 balls and put 3 on each side of the scale.
IF the scale is balanced THEN
Remove those balls and put remaining two balls on one each side of the scale.
The side where scale goes down has the more weight ball.
ELSE (The scale is not balanced)
Pick any 2 from the side goes down (more weight side) and put them on the scale one each.
IF the scale is balanced THEN
you know third one is more weight.
ELSE (The scale is not balanced)
The side goes down has the more weight ball
END IFType: IQ quiz
Source- Software Engineer, Job interview question @ Google
Scroll down to verify your answer.........
...
....
....
....
.....
....
....
....
....
....
....
....
...
...
...
...
...
...
...
...
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
.....
.....
Solution:
Take 6 of the 8 balls and put 3 on each side of the scale.
IF the scale is balanced THEN
Remove those balls and put remaining two balls on one each side of the scale.
The side where scale goes down has the more weight ball.
ELSE (The scale is not balanced)
Pick any 2 from the side goes down (more weight side) and put them on the scale one each.
IF the scale is balanced THEN
you know third one is more weight.
ELSE (The scale is not balanced)
The side goes down has the more weight ball
1 comments:
ya I know with scale it is very easy .
Post a Comment