Premium
React Like Button (Toggle + Counter)
Challenge summary
Build a React Like button that toggles between liked/unliked and updates a count. Clicking should add or subtract one based on current state, and the counter must never drop below zero.
What you'll practice
- Render a Like button and a like counter.
- The counter must never go below 0.
- Update button styling based on liked state.
- If the counter is 0, unliking should not make it negative.
- React focus: keep liked/count in state and guard against negative values.
What Premium unlocks
Premium unlocks the runnable workspace, behavioral checks, implementation walkthrough, and edge-case discussion. It also runs as an Interview Pressure Mode, in rounds that add requirements the way an interviewer does.
Free related practice
Public interview reports: Taro (January 2021) · Tesla frontend interview questions
Upgrade to FrontendAtlas Premium to unlock this challenge. Already upgraded? Sign in to continue.
Premium is $24 a month or $99 a year, less in many countries.