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

Programming Exercises

Build a component that finds the common elements between two hardcoded arrays and displays them.

Hard

Problem Statement

Build a component that finds the common elements between two hardcoded arrays and displays them.

Sample Input

Arrays: [1, 2, 3, 4], [3, 4, 5, 6]

Sample Output

Common Elements: [3, 4]

Limits

Time: 2s · Memory: 256 MB

Code Editor

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

import React from "react";
 
 const CommonElements = () => {
  return (
  <div>
  {/* Display common elements */}
  </div>
  );
 };
 
 export default CommonElements;