Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a component that tracks and displays how many times each button in a group of buttons has been clicked.

Medium

Problem Statement

Create a component that tracks and displays how many times each button in a group of buttons has been clicked.

Sample Input

Buttons: ["Button 1", "Button 2", "Button 3"]

Sample Output

Each button displays its own click count.

Limits

Time: 2s · Memory: 256 MB

Code Editor

Try your code in this preview. Submit marks it done.

import React, { useState } from "react";
 
 const ButtonClickTracker = () => {
  return (
  <div>
  {/* Render buttons with click counts */}
  </div>
  );
 };
 
 export default ButtonClickTracker;