FastPrepMerge K Sorted Sequences
Problems/Merge K Sorted Sequences

Merge K Sorted Sequences

Citadel logoCitadel● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Citadel new grad phone screen. The interviewer asked to merge K sorted arrays. Another candidate reported merging k lists with O(k) space instead of O(n), and no merging in pairs.

The first report used a C++ abstract array interface with shared pointers and helper methods. Here, finite integer arrays give the same merge task. The solution discusses the interface wrapper, and tests do not check it. We specify empty inputs, duplicates, and numeric limits.

Our version is about 95% the same as the reported questions.

Merge k sorted integer sequences into one nondecreasing array. Keep every occurrence, including duplicates. Empty sequences are allowed.

Use at most O(k) auxiliary space, excluding the input and returned array. Do not flatten and sort the input or repeatedly merge pairs of sequences.

Function

mergeSortedSequences(sequences: int[][]) → int[]

Examples

Example 1

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

Each sequence contributes its smallest remaining value. The result is [1,1,2,3,4,4,5,6].

Example 2

sequences = [[],[-2,-2,7],[]]return = [-2,-2,7]

Empty sequences contribute nothing. Both copies of -2 remain in the result.

Constraints

  • 0 <= sequences.length <= 1000
  • Each sequence is sorted in nondecreasing order.
  • The total number of elements is at most 100000.
  • -1000000 <= each element <= 1000000
  • Use O(k) auxiliary space, excluding the input and returned array, where k is sequences.length.

More Citadel Phone Screen questions

  • Portfolio Tickers with Constant-Time Random PickPHONE SCREEN · Seen Nov 2026
  • Square Root FunctionPHONE SCREEN · Seen Oct 2026
  • Reachable Transfer PositionsPHONE SCREEN · Seen Oct 2026
  • Spreadsheet Formula DependenciesPHONE SCREEN · Seen Oct 2026
  • Merge Price-Delta FeedsPHONE SCREEN · Seen Sep 2026
  • Reconcile Unmatched Trades with Timestamp TolerancePHONE SCREEN · Seen Sep 2026
  • Top Ten Trades by Notional ValuePHONE SCREEN · Seen Sep 2026
  • Exchange BBO and Market-Wide NBBOPHONE SCREEN · Seen Sep 2026
  • Maximize Workday EarningsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Minimum Changes for Palindromic BlocksOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Maximum Number of Events That Can Be AttendedByteDance · PHONE SCREENByteDance interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN
  • Defer Expenses to Preserve BalanceDRW · PHONE SCREENDRW interview questions
  • Select the Top User MatchesDuolingo · PHONE SCREENDuolingo interview questions
  • Meeting Rooms IIQuince · PHONE SCREENQuince interview questions
  • Kth Largest Element in an ArrayLinkedIn · PHONE SCREENLinkedIn interview questions
  • Meeting Rooms IISecuronix · PHONE SCREEN
  • Minimize Array Sum After K Halving OperationsDocuSign · PHONE SCREENDocuSign interview questions

Interview reports that mention this question

  • Citadel SWE Intern First-Round Questions: 20 Experiences

Citadel interview experiences

  • Citadel Securities Quant Researcher Intern Loop: 1 Experience
  • Citadel Securities Research Engineer Interview: 1 Experience
  • Citadel Securities SWE Intern First Round: 2 Experiences
  • Citadel Securities Experienced SWE Interviews: 1 Experience
  • Citadel SWE Intern Later Rounds and Superday: 13 Experiences
All Citadel interview questionsSee Citadel hiring insights
Saved
class Solution {
    public int[] mergeSortedSequences(int[][] sequences) {
        // write your code here
    }
}
Checking account…