As reported: Confluent Senior Software Engineer II / SSE 2 loops (2025–2026), coding round: part 1 validates a Sudoku board, part 2 (the next question) solves one by reusing the validation. In one round the interviewer asked for less memory after a first version with three boolean tables (rows, columns, boxes). Rounds asked for production-quality code and running it against the interviewer's test cases.
This is LeetCode 36 — Valid Sudoku. Our write-up: /valid-sudoku.
You are given a 9 × 9 Sudoku board. Only the filled cells need to be checked:
- Each row contains the digits
1–9at most once. - Each column contains the digits
1–9at most once. - Each of the nine 3 × 3 boxes contains the digits
1–9at most once.
Empty cells are ".". A board can be valid without being solvable — only these three rules are checked.
Example 1
board =
[["5","3",".",".","7",".",".",".","."]
,["6",".",".","1","9","5",".",".","."]
,[".","9","8",".",".",".",".","6","."]
,["8",".",".",".","6",".",".",".","3"]
,["4",".",".","8",".","3",".",".","1"]
,["7",".",".",".","2",".",".",".","6"]
,[".","6",".",".",".",".","2","8","."]
,[".",".",".","4","1","9",".",".","5"]
,[".",".",".",".","8",".",".","7","9"]]
Output: true
Example 2
The same board with the top-left 5 changed to 8. Output: false — column 0 and the top-left box now hold two 8s.
Constraints: board.length == 9, board[i].length == 9, board[i][j] is a digit 1–9 or ".".
Code runner format: one JSON value per line: board. Implement isValidSudoku(board), returning true or false.
Clarifications
- The round described the board as N × N; the runner uses the classic 9 × 9 board. The same code works for any N = k² with boxes of k × k.
- Follow-up from the round: after a first version, reduce the extra memory.