Amazon Interview Question for Software Engineer / Developers


Country: India




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

In bag1 place only one red ball and put all the remaining red and black balls on bag2.

prob: 1*0.5+49/99*0.5

- Sathiya January 23, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Wot about white balls? have you taken white balls to your home......

- kk January 23, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I agree with Sathiya (except the white balls need to be included in the second bag as well).

- Will_In_Seattle January 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Actually, its only white and red balls, and 2 bags :)

- Shashi January 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

oops... read black as white

- Sathiya January 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

His solution is correct.

- Nitin Gupta January 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Normal Scenario.
Let's say we do it like this
Jar A - 50 Red Balls
Jar B - 50 Green Balls

So Probability will be 0.5*1 + 0.5*0 = 0.5

But we are not getting any number from jar B as there is no Red Ball. So to increase the chances we do like this.

Jar A - 1 Red Ball
Jar B - 49 Red Balls and 50 Green Balls

So Probability will be 0.5*1 + 0.5 * (49/99) = 74/99.

So the maximum probability will be 74/99 of picking the red ball from a random jar.

- aman January 24, 2013 | 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