Amazon Interview Question for Software Engineer / Developers






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

I think the question was to get a uniform distribution between 1 to 12. So mark 3 faces with 0 and the other 3 with 6. Then each number from 1-12 has the same probability of 1/12.

- Anonymous July 01, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yeah ... this solution makes sence

- kiwi July 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think this is the correct solution assume the interviewer's original intent

- Ted May 03, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

1/6 * 1/2 = 1/12 makes sense..

- nikhil March 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
4
of 4 vote

A normal dice has numbers from 1-6. So, if u are asked to fill the second dice from 0-6, then fill up all sides of second dice with 0s. so, that we have an equal probability of getting results.

- Sean June 30, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

That was quite smart! ;-)
I really doubt if most of the posters reread the question before they hit the submit key! Confusing and waste of time.

- sorcerer July 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

No but in this case the probability of getting 0 is 6/12 = 1/2 and any other digit like 1 has the probability = 1/12

- erappy July 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

See, I thought the same thing.. all zeros.. BUT I REREAD the question and didn't it say FROM 0-6 ..which means 0, 1, 2, 3, 4, 5, 6 inclusive??

Either the poster got the question wrong, or the interviewer is inexperience.

- Anonymous July 11, 2010 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

Yes guys,

The answer is 000666. I meant fill out the faces with numbers taken FROM the range 0-6. Sorry to confuse you guys.

- Loony February 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hi Loony, what was your answer to this question? Can anyone post your ideas please? Was it a phone interview or on site?

- Anonymous June 30, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Does the sum of numbers on both dice have an equal probability?

- Cavey June 30, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

How to fill the dice with 0-6 when there are 6 faces and 7 numbers...can you elaborate the question please?

- Harit June 30, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

mark all face by 6 , Or all face by 0 , or 3 face by 6 and by 0.

probability of all possible appearing number will be same in all above three case

- code bug July 01, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Isn't having the numbers on the second dice such that each number on the second dice has equal probability of coming should be the answer to this question?

Thus, the possible solutions could be
- (1,2,3,4,5,6)
- (0,0,0,0,0,0,0)
- (1,1,1,1,1,1)
.......(6,6,6,6,6,6)
- (0,0,0, 6,6,6)
and so on

- Anonymous July 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Considering your argument. I think correct solution be only.
mark 3 face by 0 and 3 by 6. Because this is the only case in which we will be able to roll all number from 1-12 with equal probability. In all other case we won't be able to roll all numbers. though its not given in Q that we have to roll number from 1-12. I am assuming it.

- Code bug July 02, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

yes...this is the correct answer...as in this case, the probability of getting a number in the range [1,6] or [7,12] is same = 1\2 (due to dice with three faces with 0 and three faces with 6) * 1\6 (due to normal dice)

- Anonymous July 03, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

No, it's not correct.

See, I thought the same thing.. BUT I REREAD the question and didn't it say FROM 0-6 ..which means 0, 1, 2, 3, 4, 5, 6 inclusive?? which means you HAVE to you use 0, 1, 2, 3, 4, 5, 6.

Either the poster got the question wrong, or the interviewer is inexperience.

If it was rephrased to something like:
"Given a normal dice and a dice with blank faces, fill in the blank dice with ANY NUMBER OR NUMBERS from 0 to 6, so that the probability of each number coming up, when you roll the two dice together, is equal."

Then it's a possible solution.

So it's either the poster got the question wrong, or the interviewer is inexperience. Post it correctly next time.

- Anonymous July 11, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

ans is

000666

- coder August 06, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

My interpretation of the question is that we have to get the same prob distribution of the sum of the nos. on the 2 rolled dices ( total 36 possible outcomes and prob of getting 2 is 1/36 , 3 is 2/36 , 4 is 3/36 and so on upto 12 which is 1/36 ) . If we are asked to fill the blank dice with nos from 0 to 6 , then obv the same nos. i.e. 1,2,3,4,5,6 would solve the prob ( if my interpretation is correct )

- Mandar September 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@ Mandar In your solution, you urself saying the probabilities of getting 2,3,4,.... are different.... I think 000666 makes complete sense..... Since in that case, you roll two dices and any two distinct solution with give you numbers from 1-12 with equal probability 1/12.......

- shekhar2010us February 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Mark all faces as 3. The expected mean will become 6.5. Which is the expected mean of a uniform distribution of 1/12 with numbers from 1 to 12.

- Waleed January 02, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Mark all faces as 3. The expected mean will become 6.5. Which is the expected mean of a uniform distribution of 1/12 with numbers from 1 to 12.

- Waleed January 02, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Not sure if I understand the question correctly, if it just want an equal distribution of number when play 2 dies, the solution can be using all same number for the blank sites:

e.g. 1st die with 1,2,3,4,5,6+ 2nd die 1,1,1,1,1,1
or 1st die with 1,2,3,4,5,6 + 2nd die 2,2,2,2,2,2

- Eva February 21, 2017 | 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