Comment hidden because of low score. Click to expand.

Comment hidden because of low score. Click to expand.

Comment hidden because of low score. Click to expand.

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

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.

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.

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.

Two.

- Nex3 December 07, 2006It's easiest to think about this in terms of cases. In addition, I'll use notation for the balls such that ? represents a ball whose weight you don't have any idea about, H represents a ball that could be heavy, and L represents a ball you know to be light. When you begin, you have eight balls, none of which you know the weight of.

????????

First, you take six of those balls, and weigh them, three on each side. Then either:

1) One of the sides is heavier.

or

2) Neither of the sides are heavier.

In case 2, you know that six of the balls are not the heavy ball. You don't know about the other two.

??LLLLLL

You then take one of the ? balls, and weigh it against one of the L balls. Again there are two possible outcomes:

2.1) The ? ball is heavier.

2.2) The balls are the same.

In case 2.1, we know that the ? ball we just weighed must be the heavy ball, because it's heavier than a ball we know to be normal. In case 2.2, we know that the ? ball we *did not weigh* must be the heavier ball, because we know all other balls to be light.

Now let's jump back to case 1. In this case, three of the balls we weighed could be the heavy ball; the rest must be light.

HHHLLLLL

Our next weighing has one of the H balls against another H ball. This time, there are three ways the weighing could turn out:

1.1) The first H ball is heavier.

1.2) The second H ball is heavier.

1.3) The balls weigh the same.

In cases 1.1 and 1.2, we now know which of the balls is heaver. In case 1.3, the two balls we weighed must be light, because there's only one heavy ball; thus, there is only one possibly heavy ball remaining, so that ball must be the heavy ball.