Amazon Interview Question
Software Engineer / DevelopersCountry: CANADA
Interview Type: In-Person
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.
Without going into specifics, a general idea would be:
- puneet.sohi April 08, 2014