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

Programming Exercises

Develop a component that merges two hardcoded arrays of objects based on a common property and displays the merged array.

Hard

Problem Statement

Develop a component that merges two hardcoded arrays of objects based on a common property and displays the merged array.

Sample Input

[{ "id": 1, "name": "Alice" }, { "id": 2, "name": "Bob" }]
 [{ "id": 1, "age": 25 }, { "id": 2, "age": 30 }]

Sample Output

Merged Array: [{ id: 1, name: 'Alice', age: 25 }, { id: 2, name: 'Bob', age: 30 }]

Limits

Time: 2s · Memory: 256 MB

Code Editor

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

import React from "react";
 
 const MergeArrays = () => {
  return (
  <div>
  {/* Display the merged array */}
  </div>
  );
 };
 
 export default MergeArrays;