A tic-tac-toe board with a robot holding a sword and a shield

How I Built an Unbeatable Tic-Tac-Toe Bot, Level by Level

My first bot picked squares at random. I beat it in 3 moves. I’m working through LLD problems, and tic-tac-toe was the third one I picked. Building it for two players was the easy part. Then I added a bot, and it hooked me for days. Every time I beat it, I added a new rule. Every time I added a rule, I found a new way to beat it. This went on until one day I just… couldn’t win anymore. Only draws. ...

November 10, 2026 · 8 min · 1661 words · Hitesh Patel