Booz Allen Hamilton interview question

How would you design an AI that plays tic-tac-toe against a human using JavaScript?