FastPrepMerge K Sorted Lists
Problems/Merge K Sorted Lists

Merge K Sorted Lists

Bloomberg LP logoBloomberg LP● HardNEW GRADPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The source names this well-known problem, and the official statement gives the full merge task. We pass the linked-list values as arrays so the answer can be checked, and we added practical limits. Our version is about 99% the same as the reported question.

You are given k singly linked lists, each sorted in nondecreasing order. Here, lists[i] holds the node values of the i-th list from head to tail.

Merge all lists into one sorted linked list and return its values from head to tail. Reusing existing nodes or constructing an equivalent merged list are both acceptable.

Function

mergeKSortedLists(lists: int[][]) → int[]

Examples

Example 1

lists = [[1,4,5],[1,3,4],[2,6]]return = [1,1,2,3,4,4,5,6]

At each step, take the smallest value at the front of the three lists. This builds the merged list shown in the output.

Example 2

lists = []return = []

With no input lists, the merged list is empty.

Example 3

lists = [[],[-2,0,7],[]]return = [-2,0,7]

Two of the lists are empty, so every value comes from the middle list, and they are returned in the same order.

Constraints

  • 0 <= lists.length <= 10000.
  • 0 <= lists[i].length <= 500.
  • The total number of values across all lists is at most 100000.
  • -10^9 <= lists[i][j] <= 10^9.
  • Every lists[i] is sorted in nondecreasing order.

More Bloomberg LP Phone Screen 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
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
  • Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
  • Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Merge K Sorted Linked ListsBharatPe · PHONE SCREEN
  • Merge K Sorted ListsSkydio · ONSITE INTERVIEWSkydio interview questions
  • Greedy Person-Cake Matching DistanceSnowflake · PHONE SCREENSnowflake interview questions
  • LRU Cache with TTLAutodesk · ONSITE INTERVIEWAutodesk interview questions
  • Merge k Sorted ListsZS · ONSITE INTERVIEWZS interview questions
  • Merge k Sorted ListsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Thread-Safe LRU Cache with TTLLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
  • LRU Cache with Expiring EntriesPaytm · PHONE SCREENPaytm interview questions
  • Reverse Nodes in K-GroupByteDance · PHONE SCREENByteDance interview questions
  • Merge k Sorted ListsOracle · PHONE SCREENOracle 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[] mergeKSortedLists(int[][] lists) {
        // Write your code here.
    }

}
Checking account…