FastPrepMerge K Sorted Arrays
Problems/Merge K Sorted Arrays

Merge K Sorted Arrays

Rippling logoRippling● MediumINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Rippling intern phone screen. The report names merging k sorted arrays but does not give the limits or the edge rules. Our version is about 80% the same as the reported question.

You are given arrays, a collection of integer arrays. Each array is already sorted from smallest to largest.

Return one array containing every input value, from smallest to largest. Preserve duplicate values. Individual arrays may be empty. If there are no values, return an empty array.

Function

mergeSortedArrays(arrays: int[][]) → int[]

Examples

Example 1

arrays = [[1,4],[1,3,5],[],[-2,8]]return = [-2,1,1,3,4,5,8]

All seven values are retained; both occurrences of 1 remain.

Example 2

arrays = [[],[]]return = []

Neither input array contains a value, so the merged result is empty.

Constraints

  • 0 <= arrays.length <= 1000.
  • The total number of input values is at most 1000.
  • -10^9 <= arrays[i][j] <= 10^9.
  • Each input array is sorted in nondecreasing order.

More Rippling Phone Screen questions

  • Filter, Sort, and Deduplicate Scheduled TasksPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Stateful Log Transform and SearchPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Dependency-Aware Task SchedulerPHONE SCREEN · Seen Nov 2026
  • Delivery Cost Tracker with Effective-Dated RatesPHONE SCREEN · Seen Nov 2026
  • Camel CardsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best and Worst Camel Card CompletionsPHONE SCREEN · Seen Nov 2026
  • Corporate Card Expense RulesOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • In-Memory Priority Task SchedulerPHONE SCREEN · Seen Oct 2026
  • Limit an Organization Tree's HeightPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Median Across N Sorted ArraysPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • 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
  • 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
  • Merge Multiple Sorted StreamsNVIDIA · PHONE SCREENNVIDIA interview questions

Interview reports that mention this question

  • Rippling Intern Onsite Interviews: 18 Experiences (Part 4 of 5)
  • Rippling SWE Intern Interviews: 101 Experiences (Part 1 of 5)

Rippling interview experiences

  • Rippling Senior SWE Full Loop Questions: 1 Experience
  • Rippling Experienced SWE Phone Screens: 2 Experiences
  • Rippling Design Rounds and Onsites: 17 Experiences (Part 3 of 3)
  • Rippling Phone Coding Screens: 14 Experiences (Part 2 of 3)
All Rippling interview questionsSee Rippling hiring insights
Saved
class Solution {
    public int[] mergeSortedArrays(int[][] arrays) {
        // write your code here
    }
}
Checking account…