FrontendArk

Master Frontend Interviews

  • Practice
  • Playground
  • Resource
Medium

Whack-a-Mole

40 mins

Build a Whack-a-Mole game in React.

Requirements:

  1. Display a grid of holes (e.g., 3x3 or 4x4).
  2. Randomly show a "mole" in one hole at a time for a short duration.
  3. Allow the player to click the mole to score points.
  4. Keep track of the score.
  5. The game should run continuously, with moles appearing in random holes.
  6. Focus on functionality over styling.

Code Editor

React Component

00:00
Loading...

Live Preview

See your React component