Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Undo Grid Cell Click with a Delay — Dynamic Grid Where Clicked Cells Revert to Original Color Sequentially

Prompt

Generate a dynamic N×N grid (e.g., 5×5) where all cells start with the same background color (blue). Clicking a cell immediately changes it to a different color (beige) and records the click in an ordered queue. There is a Start button — when clicked, all highlighted cells revert to blue one by one in the exact order they were clicked, with a 500ms delay between each revert. After the full rewind completes the grid resets and becomes interactive again. This is a variation of the Uber frontend machine coding question. It was asked in Livespace's SDE2 machine coding round.

Generate N×N grid with all cells blue initially. Store clicked cell indices in a queue array.
Test Results

Undo Grid Cell Click with a Delay — Dynamic Grid Where Clicked Cells Revert to Original Color Sequentially

Generate a dynamic N×N grid (e.g., 5×5) where all cells start with the same background color (blue). Clicking a cell immediately changes it to a different color (beige) and records the click in an ordered queue. There is a Start button — when clicked, all highlighted cells revert to blue one by one in the exact order they were clicked, with a 500ms delay between each revert. After the full rewind completes the grid resets and becomes interactive again. This is a variation of the Uber frontend machine coding question. It was asked in Livespace's SDE2 machine coding round.