Design Tic-Tac-Toe

Easy · Low-Level Design · about 30 minutes

Asked at Microsoft, Amazon, Google, Waymo, Palo Alto Networks, CrowdStrike, Zscaler.

Design an N × N Tic-Tac-Toe game for two players. move(row, col) places the current player's mark and reports whether that move won (a full row, column or diagonal), drew the game, or play continues. Reject moves on taken squares, outside the board, or after the game is over.

Related guides