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.