Can the first player force a win at tic-tac-toe?
Two players alternate placing X and O on a three-by-three board; three in a row, column or diagonal wins.
With perfect play from both sides, does the first player win, does the second player win, or is it a draw? Give the second player's key responses to the first player's three kinds of opening (centre, corner, edge) and explain the one trap that the second player must avoid.
Show a hint
The first player's most dangerous opening is a corner. Try responding in the centre and see whether the first player can ever build a "fork", a move that creates two winning threats at once.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.