Skip to content

Implement Conway's Game of Life, updating the board in place.

Whether you notice that a naive in-place update corrupts the neighbours the next cell still needs.

CodingStandard

Who reports being asked this

Amazon · Dropbox

Attested by 2 independent sources, including 1 first-hand report, most recently around 2024-09.

What a strong answer does

The trap in Conway’s Game of Life is not the neighbor-counting logic; it is time. The rules say every cell transitions simultaneously from the original generation to the next generation. If you scan the matrix and immediately replace each cell with its new value, later cells will read a neighborhood containing a mixture of old and new states. That corrupts the simulation because a cell’s fate must depend only on the board as it was before the tick began, not on earlier positions in your traversal order.

All interview questions