Amazon Interview Question for Software Engineer / Developers






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

There would be a Game class which would consist of the board data structure and 2 arrays of Piece, i.e. Piece[]

Each Piece would have the shared values, such as the color of the piece during that game and a data structure containing N next moves. Then there would be several sub classes of Piece which would be like Knight, Queen, Pawn, etc. These classes would be used to describe the move the piece makes. When the game begins, the board structure is filled with Piece's, a side is picked, the legal moves are calculated, and the game begins. THe legal moves will be re-calculated every turn for both sides. Varying strategy algorithms and other things can be implemented for a more advanced game.

- binary bill February 20, 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