Amazon Interview Question for Software Engineer / Developers


Country: CANADA
Interview Type: In-Person




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

Without going into specifics, a general idea would be:

Class  chessPiece{
	//Variables
	/*general char variables such as 
	# moves allowed, direction constraint (rook only moves diagonally) etc
	*/
	
	//Methods:
	/*
	   chessPiece(//with custom variables for different peices)  -> ctor
	   moveMethod -> how to move chess piece with constraints, make sure 
	   the piece does not fall off the edge   
	*/

};


int main(){
	//create array of chess pieces, for both sides
	//fork two threads, each will one array. These will act like two playes.

}

- puneet.sohi April 08, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

some basic Idea. welcome comment.
1, define abstractChessPiece.
class abstractChessPiece
{
define PieceType.
define the target typePiece it can beat.
define move() function.
}

2. for each type of concreteChessPieces, need to inherit from abstractChessPiece to define there own PieceType, and target TypePiece, and move behavior.

3. for the ChessBoard,
need to define function to create ChessPieces suit for one side and for the other side.
need hold these ChessPieces and postition for each Pieces.
need to define Move function, and check this move is legal or not, and one side win or not.

- suwei19870312 April 08, 2014 | 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