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

Programming Exercises

Create a component that takes a hardcoded array of intervals and merges any overlapping intervals.

Hard

Problem Statement

Create a component that takes a hardcoded array of intervals and merges any overlapping intervals.

Sample Input

[[1, 3], [2, 6], [8, 10], [15, 18]]

Sample Output

Merged Intervals: [[1, 6], [8, 10], [15, 18]]

Limits

Time: 2s · Memory: 256 MB

Code Editor

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

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