Epic Systems Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: Written Test
The following functions -
class TicTacToe
{
......
};
constructor- > should Initialize the board , register 2 players , assign X & O to them .
Start() --> Starts a Timer for Player whose move it is to make his move .
//should contain the logic for time Out .
IsGameOver() --> if anybody has won the game / Draw / Aborted .
IsADraw() , IsWon() etc .
Stop() -> should clean up all the resources .
Class Player
{
...
};
should contain functions like myTurn , hasWon etc .
Implementation -
The Board should be represented using bitboard i.e an array of 9 bits . This results in O(1) checking of various details .
Naive Java implementation:
- Suz February 22, 2012