FastPrepMerge K Sorted Interval Lists
Problems/Merge K Sorted Interval Lists

Merge K Sorted Interval Lists

Bloomberg LP logoBloomberg LP● MediumNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The Bloomberg new-grad second virtual-onsite report asks for Merge Intervals widened to k lists of intervals. In our version, intervals include both ends and sharing an end point means they merge. Each input list is already sorted with no overlaps inside it, so a k-way heap merge keeps the multi-list shape of the report.

You are given intervalLists, an array of interval lists. Every interval is a closed pair [start, end].

Within each list, intervals are sorted by increasing start and do not overlap. Merge all intervals from all lists so that every pair that overlaps or shares an endpoint belongs to one output interval.

Return the merged, non-overlapping intervals sorted by increasing start.

Function

mergeKIntervalLists(intervalLists: int[][][]) → int[][]

Examples

Example 1

intervalLists = [[[1,3],[7,9]],[[2,5],[10,12]],[[6,8]]]return = [[1,5],[6,9],[10,12]]

The first two lists merge [1,3] with [2,5]. The intervals [6,8] and [7,9] form the second merged interval.

Example 2

intervalLists = [[],[[1,4]],[[4,6]]]return = [[1,6]]

The empty list contributes nothing. The other intervals share endpoint 4, so their closed ranges merge.

Example 3

intervalLists = [[[-5,-3],[0,2]],[[3,4]],[[8,10]]]return = [[-5,-3],[0,2],[3,4],[8,10]]

No intervals overlap or share an endpoint, so all four remain separate and sorted.

Constraints

  • 1 <= intervalLists.length <= 10000.
  • The total number of intervals across all lists is between 1 and 100000.
  • Every interval contains exactly two integers [start, end] with -10^9 <= start <= end <= 10^9.
  • Each individual list is sorted by increasing start and contains no overlapping intervals.

More Bloomberg LP Onsite Interview questions

  • Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent WordsONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Decode StringPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Minimum Replacements to Make Two Strings AnagramsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Meeting Rooms IISalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Generate Complete Inputs for a Supplied ClassifierGeneral Motors · ONSITE INTERVIEW
  • Meeting Rooms IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Minimum Workers with Job AssignmentsLyft · ONSITE INTERVIEWLyft interview questions
  • Minimum Classrooms for CoursesGoogle · ONSITE INTERVIEWGoogle interview questions
  • Employee Free TimeIDFC Bank · ONSITE INTERVIEWIDFC Bank interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
  • Minimum Meeting RoomsJP Morgan Chase · OAJP Morgan Chase interview questions
  • Maximum Number of Events That Can Be AttendedSnowflake · PHONE SCREENSnowflake interview questions

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public int[][] mergeKIntervalLists(int[][][] intervalLists) {
        // Write your code here.
    }

}
Checking account…