Google interview question

design algorithm for tic-tac-toe