Create a Grid of N×N Size and Incrementally Update Cell Value on Click — Okta Machine Coding Grid Challenge
Accept a number N as input and render an N×N grid of cells. Each cell is initially empty. Clicking an empty cell fills it with max(existingNumbers) + 1 — i.e., it gets the next incremental value. Clicking a non-empty cell updates its value to max(existingNumbers) — the current maximum. The grid must be well-structured with modular components, use optimal state management to avoid unnecessary re-renders, compute the maximum value efficiently, and have clean minimal UI. Bonus points for explaining performance considerations. This was asked in Okta's SDE2 frontend machine coding interview.