Epic Systems Interview Question
Software Engineer InternsCountry: United States
Interview Type: Phone Interview
This is basically the game Othello.
If the blue and red tiles are already given, then you iterate though the red tiles, then find the lengths of spokes from the red square in terms of blue tiles. There will either be four or eight spokes, depending on whether the game accommodates diagonals.
For a long running game, you can maintain a data structure that has the color of each square and the length of the spokes from that square, for both colors. (If the board is small enough, you should just recompute on the fly). If you have Othello rules and flip a whole run of colors, you have to obviously update the data structure for each cell flipped, which means propagating out through the spokes for each cell flipped.
My gut says that the interviewer isn't testing your knowledge of data structures and algorithms with this question; it's more about showing basic coding nuts and bolts.
was this asked in the online test?
- nisha December 02, 2013