Amazon Interview Question for Software Engineer / Developers






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

How about this? Putting all 50 white beads in one bin, all 50 black beads in the other bin. Then choose one bead out of any bin if the bead is white, then you know the bin contains only white, so you can choose only white beads. If the first chosen bead is black, then we choose the other bin and also you can choose only white beans...

- Anonymous January 08, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think you get point....

- shoushou January 23, 2009 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Very stupid question. Nothing to do with performance ~~~
Stupid !!!

- Saga Yao March 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

What performance are you expecting, division of beads?

- Erik March 22, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

a white bead in one bin, 49 white bead and 50 black bead in another bin.

- jc November 13, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

right on the money.

- Anon February 18, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

the bin has a max capacity of 50.putting 25 w 25 b in each bin will give a prob of 1/4 (1/2 * 1/2) for the event which is the max achievable. what do u think ?

- XYZ November 15, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

It is 1/2 in this case.
Probability of choosing one of the either box is 100% (The bead would be taken from one of the two boxes, there is no 3rd box)

- A April 06, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The problem is trivial if you say that each bin MUST have exactly 50 marbles. We get an invariant in that case (w/50 + (50-2)/50)*1/2 = 1/2.
It gets little tricky to get the answer when you relax that rule. jc's answer makes sense in which case.

- knap November 16, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

hi jc
How yu put one bead in each bin and remaining in the other .As in the problem given we have to put 50 bead in each bin

- ravi November 17, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Let x be the number of white beads in 1 bin. The other bin has (50-x).

Probability of choosing white bead in first bin = x/50 * 1/2 (probability of choosing 1st bin).

Probability of choosing white bead in second bin = (50-x)/50 * 1/2

Probability of choosing a white bead in any bin = sum of the two. = 1/2.

- G May 13, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if you think about it mathematically it's 50% what ever you do... however I did not see them set any constrains on the box or how you put them in... lets say I have a 5x5 (marble) box that can be tightly packed. I put the 25 blacks on the bottom. and rest of the whites on top if you draw from the top it's always white... you can take this to with a 50x1x1 box too i guess just like a stack.

- Charles Wang May 22, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

LOL. You need to some reading, "mathematically" speaking.

- LOler May 23, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Again as T said in one of the posts in this section, most of the visitors have a reading comprehension problem here. The 1st one is the right answer..

- VK July 07, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The first answer cannot be right as the question specifically says that there must be 50 beads in each bin. Statistically there is no way then to maximise your chances of choosing any particular colour - as shown by XYZ, knap and G. In practice however, there would be several ways such as placing white beads on top (mentioned) and putting all the white beads in the bin on the right for right-handers. Of course, if the clause to put exactly 50 beads in each bin falls away, then the first answer is very good.

- Blake September 04, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Actually, JC is exactly right. While there will always be 50 beads, the first thing that is done statistically, is choosing a bin, a 1/2 chance. The second event is the number of beads in the selected jar. So, if you put 1 white bead in the first bin, that gives you a 100& chance of picking white IF that bin is selected (a 1/2 chance).

Putting all of the remaining beads in the second bin ensures a virtual 50/50 chance of picking white. Therefore, IF that bin is selected, the odds are 1/2 that its white. this leaves you with the following chance:

Bin 1: 100% chance of picking white * 1/2 chance of bin 1 being chosen = 50%
Bin 2: 50% chance f picking white * 1/2 chance of bin 2 being chosen - 25%

Add the two together, and you have a 75% chance of choosing a white bead in this scenario.

Statistically, We've maximized our chances.

- Frank January 16, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@ Frank: Question says : 50 beads in each bin.. in your case u r putting 99 beads in bin 2

- Sagar February 10, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Lol...you are one dumb man...

- Loler August 31, 2010 | 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