Reported May 2026
Hebbiasimulation

Ultimate Tic-Tac-Toe Move Simulator

Reported by candidates from Hebbia's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Hebbia OA. Under 2s to a working solution.
Founder's read

The Hebbia OA reported in May 2026 is a simulation problem dressed up as a game. Everything hinges on one data structure: a 9x9 char grid, plus a 3x3 array tracking each small board's status (open, captured by X, captured by O, or full). Get that state right and the rest is bookkeeping. Get it wrong and the validity string drifts by one bit. Up to 100000 moves means no fancy search, just careful rule order. If you blank on the rule checks, StealthCoder runs invisibly during the live OA as a safety net. Here's the script.

The problem

Simulate Ultimate Tic-Tac-Toe from attempted moves. The game has a 3 × 3 grid of small 3 × 3 boards. Each move is boardRow,boardCol,cellRow,cellCol,player. Apply valid moves only and do not enforce alternating turns.
The previous valid move's cell coordinates force the next move into the corresponding small board.
If that forced board is full or captured, the next move may use any playable board.
A captured board is closed. Three captured boards in a row, column, or diagonal win the overall game.
Reject malformed moves, invalid coordinates or players, occupied cells, wrong forced boards, closed boards, and moves after an overall win.
Return: a validity bit string, the overall winner or None, the next forced board as r,c, * when any board is allowed, or None after a win, followed by the nine rows of the 9 × 9 display.

Function
simulateUltimateTicTacToe(moves: String[]) → String[]

Examples
Example 1
moves = []
return = ["","None","*",".........",".........",".........",".........",".........",".........",".........",".........","........."]
An empty game has no winner, no forced board, and a blank display.
Example 2
moves = ["0,0,1,2,X"]
return = ["1","None","1,2",".........","..X......",".........",".........",".........",".........",".........",".........","........."]
The cell coordinates force the next move to small board 1,2.
Example 3
moves = ["0,0,1,1,X","0,0,0,0,O","1,1,0,0,O"]
return = ["101","None","0,0",".........",".X.......",".........","...O.....",".........",".........",".........",".........","........."]
The second move ignores the forced board and is rejected; the third is valid.

Constraints
0 <= moves.length <= 100000
There are exactly nine 3 × 3 small boards.
Valid players are X and O.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is validating in a strict order and updating state only on success. Parse the move, reject if malformed, coordinates out of 0-2, or player not X or O. Then check for an overall win, then closed board, then forced board mismatch, then occupied cell. Only then place the mark. After placing, check that small board for three in a row. If captured, mark it closed. Check the big 3x3 for an overall win. Set the next forced board from cellRow,cellCol, but if that board is full or captured, set it to any. After a win, output None. The pitfall is a full board with no winner: it's also unplayable, so track a fill count. Also remember captured boards still display their cells as placed. Parse carefully, since a malformed string can throw before you reach the rules. If the live OA freezes you, StealthCoder can hand you a working skeleton.

Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.

If this hits your live OA

You can drill Ultimate Tic-Tac-Toe Move Simulator cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Hebbia's OA.

Hebbia reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Ultimate Tic-Tac-Toe Move Simulator FAQ

How hard is the Ultimate Tic-Tac-Toe simulator really?+

Algorithmically easy, but it's a long spec with many rejection rules. Difficulty comes from ordering checks and tracking state correctly, not from any clever technique. Expect most of your time to go to edge cases like full boards and malformed input.

What's the core trick?+

Keep a 9x9 grid, a 3x3 board-status array, a fill count per small board, and a forced-board variable. Validate in a fixed order, mutate only when every check passes, then recompute the forced board and the winner.

What happens when the forced board is full or captured?+

The next move may go in any playable board, so output * for the forced board. Check this right after each valid move, using the target board's status and fill count. A full board with no winner counts as unplayable too.

Which edge cases break most solutions?+

Malformed strings with the wrong number of fields, non-numeric coordinates, lowercase or unknown players, and moves after an overall win. Also the first move, where no board is forced. Alternating turns are not enforced, so don't add that check.

How do I prepare for this in 48 hours?+

Write the simulator once from scratch with the checks in order, and test it against the three given examples. Practice small-board win detection and the 9-row display output. Keep parsing and rule logic in separate helper functions so bugs are easy to isolate.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Hebbia.

OA at Hebbia?
Invisible during screen share
Get it