Amazon Interview Question for Software Engineer / Developers


Country: India
Interview Type: In-Person




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

1st dice 0 1 2 3 4 5
2nd dice 0 1 2 6 7 8

'6' can be inverted to get '9'

- Anonymous November 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

What if 5 shows up on 1st die and 8 on the 2nd die. How will just justify 58 or 85 as a month date ?

- Anonymous November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

It is not like you have to toss the dices....you just should be able to show all the dates from 01 to 31 using these two dices.
So, 58 or 85 wont be shown..... e.g. if you are told like "show me 25".... then you should show 25 using these two dices.

- Anonymous November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Oh okay. got that! otherwise it looks impossible.

- Anonymous November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

6-9 flip that's awesome idea.....
great job...

- PKT November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Not to mention that it's an extremely shitty interview question

- dr.house November 15, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

AMEN to that - "Not to mention that it's an extremely shitty interview question"

- amit November 25, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 votes

1st dice 0 1 2 3 4 5
2nd dice 1 2 6 7 8 9

we need only one '0' digit

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

How can one get the dates like 13,14,15?

- Rohit September 29, 2013 | Flag
Comment hidden because of low score. Click to expand.
3
of 3 vote

1,2,4,5,6,0
1,2,3,7,8,9

This should work if we are allowed to represent 01 as 1 using single dice...

- Anonymous November 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I cant get 09 , 19 , 29 !

first dice : 0,1,2,3,4,5
second dice : 0,1,2,6,7,8

- Buzz_Lightyear November 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Can you reuse any number?? :)

- explorer.bit November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Ya the question specifies that we can reuse the number !

- Buzz_Lightyear November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

This was a hint Lightyear ... I am not asking you, but, I am giving hint that you should reuse one or more numbers. Get this hint and you are done :)

- explorer.bit November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I was also not able to do it at first, but Hiring manager gave this hint and within 5 seconds I got that hint. So it is just tricky, try to get it. Else I'll tell the solution.

- explorer.bit November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Reuse numbers in the same dice ??

- Buzz_Lightyear November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

GOT IT ! 9 inverted is 6 !
Good one !
Finally understood "reuse" :) lol!

- Buzz_Lightyear November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yes You got it ... :)

- Anonymous November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

if you get 0 , 0 -- that doesn't correspond to any date of a month

- inasaa November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Please try to understand that it is not about outcome of throwing two dices....It's just about you should be able to show all the valid dates(01-31) ,..... so (0,0) doen't make sense, coz no one will ask you to show 00 or 85 or 92 etc.

- explorer.bit November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think the following combination also works:
012348
012567
We flip 6 as 9. This works well for all dates from 01-31.

- aish November 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yeah, actually the solution is to repeat 0,1,2 in both the dices and distribute 3,4,5,6,7,8 in the remaining faces of the dices with any combination. You just have to invert '6' for showing '9'.

- explorer.bit November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

0,1,2,4,7,8
0,1,2,3,5,6

- Anonymous November 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

0,1,2,9,4,5
1,2,3,6,7,8

- ravindra November 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I didn't see anything that indicated that BOTH die needed to be roled... just an implied assumption, if they both were.
Die 1: 0, 1, 2, 2, 3, 3 (something like - statistically there are probably more 2's & 1's... one'd have to verify)
Die 2: 4, 5, 6, 7, 8, 9
To get the 13th - roll die 1 twice, etc.
I saw nothing in req. that would preclude this - an upside number is just that.
Needed to be accurate across both dice, not that both are rolled... Just a thought

- Maren Harrison-Gaffney November 22, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

D1: 012345
D2: 876120
This will give all possible english dates considering 6 with 9 as well

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

123789
124560

- beginner99 December 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

0,1,2,3,4,5
0,1,2,6,7,8

- RJLBatty January 31, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

123456 Dice 1
789012 Dice 2

- anon February 12, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

012012 on first Dice
345678 on the second Dice
as 6 can be treated as 9, so we can get all the date combinations of English month.

- Ajay Kumar February 28, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1 and 2 are needed on both to show day 11 and day 22. However, there is no reason to have 0 on both as 00 is not a day. so we have 8 left spaces and numbers 0,3,4,5,6,7,8,9 which can be put in any way

- cr August 26, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

my bad! lol

- cr August 26, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Just struck me !
i can show 9 instead of 09

First dice : 0,1,2,3,4,5
Second dice : 1,2,6,7,8,9

- Buzz_Lightyear November 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

You always have to show both the dices .... like I have shown in question.

- explorer.bit November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Then I dont think its possible , you ll invariably leave one digit out of the two dices and you wont get three dates

- Buzz_Lightyear November 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

you won't get 30 with this combination

- inasaa November 14, 2012 | Flag


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