The Like/Dislike button pair is a fundamental UI pattern found on YouTube, Reddit, and every social platform. Building it correctly requires handling mutually exclusive toggle state: liking should un-dislike, disliking should un-like, and clicking an active button should deactivate it.
Build a LikeDislike component that shows a thumbs-up count, a thumbs-down count, and two interactive buttons. The interaction rules are: clicking Like toggles it (and removes Dislike if active). Clicking Dislike toggles it (and removes Like if active). Counts update accordingly.
This question tests your ability to model mutually exclusive UI state cleanly without complex conditionals. The ideal solution uses a single state variable (not two booleans) to represent three possible states: liked, disliked, or neutral.