Amazon Interview Question for Software Engineer / Developers






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

1. put your 1st coin in the center.
2. wherever your opponent put his coin, place your coin in the mirror position based on your 1st coin.
Reason: whenever your opponent can find a place, so will you.

- try4fun December 08, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

There is no center for a table that holds an even number of coins.

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

try4fun's solution works.
Whenever player 2 can find a slot, player 1 can.
So the game will only terminate when player 2 can not find a slot. Player 1 wins.

- Anonymous March 14, 2009 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Found this link as useful.

http://everything2.com/title/Quarter%2520Game%2520solution

- Ganesh December 11, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if the turns are even, opponent should first,
if the turns are odd, we should start first.

- Anonymous December 19, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

read the question
If you are starting first ...

- Anonymous January 04, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Assuming that we know the area of the table and the coin in advance, we can divide the table in to multiple slots where the coins can be placed in a structured manner. If the first player should always win then make the number of slots odd.

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

No, player 2 is also smart enough to break your slot assignment strategy. Player 2 can put a coin not within the slot, but occupy multiple slots, which forcing the number of slots even.

- Anonymous March 14, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think most visitors of this site have a serious reading comprehension problem!

The very first post has the right solution!

- T March 14, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The first post assumes that every circle on a table can be filled by even number of coins. What if circle can be filled by odd number of coins.

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

Erik,

Suppose the first player places a coin in the exact center.

Now no matter where the second player places the next coin, the first player will place the coin in a diametrically opposite fashion.

And, the matter of "filling" the table with odd/even number of coins... So what if you can? How does that particular arrangement of coins prove anything?

In this case, the first player _forces_ an arrangement, such that he always has a spot to put a coin in. Does not matter how you can fill the table with some other arrangement.

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

I agree with try4fun's solution but there might still problem if
the size of perimeter of circular table is not good enough to hold even numbers of coins.
So, logically his ans is perfect but does not make sure that his algorithm works.

- sanjeev April 03, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Once you capture the middle position, for every position that the opponent can place, you can place the exact opposite.

- Tazzy July 15, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

i think the logic for winning tic tac toe problem is also similar...

- T October 03, 2009 | 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