Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Merge Prototype Test Windows

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Merge Prototype Test Windows. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Given an array of intervals windows, where each interval is [start, end] and represents an inclusive time window during which a prototype test was run, merge all overlapping intervals and return the merged result sorted by start time. This is useful for consolidating repeated or adjacent validation runs into the smallest set of continuous test windows.

Constraints

  • 1 <= len(windows) <= 10^4
  • windows[i].length == 2
  • 0 <= start <= end <= 10^9
  • The output must be sorted by interval start

Function Signature

def merge_test_windows(windows):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output