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

Draw Circle on Click with Undo Redo and Reset Action in React — Circles Game with Full Command History

Prompt

Build a React application where clicking anywhere on the board area draws a circle at the click position. Each circle gets a random color from a predefined list (red/blue/green/orange/purple). The app must support: Undo — removes the last-added circle (LIFO order) with a smooth fade-out animation; Redo — re-adds the last undone circle; Reset — clears all circles and the entire history stack. Maintain two stacks: a drawn stack and an undone stack. Push to drawn on click; pop from drawn and push to undone on undo; pop from undone and push to drawn on redo; clear both on reset. This was asked in Hiver's SDE2 frontend interview.

Hint content will be added for this problem soon.
Test Results

Draw Circle on Click with Undo Redo and Reset Action in React — Circles Game with Full Command History

Build a React application where clicking anywhere on the board area draws a circle at the click position. Each circle gets a random color from a predefined list (red/blue/green/orange/purple). The app must support: Undo — removes the last-added circle (LIFO order) with a smooth fade-out animation; Redo — re-adds the last undone circle; Reset — clears all circles and the entire history stack. Maintain two stacks: a drawn stack and an undone stack. Push to drawn on click; pop from drawn and push to undone on undo; pop from undone and push to drawn on redo; clear both on reset. This was asked in Hiver's SDE2 frontend interview.