FastPrepMerge Sorted Array
Problems/Merge Sorted Array

Merge Sorted Array

Atlassian logoAtlassian● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian full-time online assessment. The report links to the exact Merge Sorted Array exercise but does not copy its full statement. Our version follows that linked exercise. The function you write returns the result.

nums1 has length m + n. Its first m values and the first n values of nums2 are each sorted in non-decreasing order; the remaining slots of nums1 are placeholders.

Merge the two valid portions into non-decreasing order and return the resulting nums1.

Function

mergeSortedArray(nums1: int[], m: int, nums2: int[], n: int) → int[]

Examples

Example 1

nums1 = [1,2,3,0,0,0]m = 3nums2 = [2,5,6]n = 3return = [1,2,2,3,5,6]

The valid portions [1,2,3] and [2,5,6] merge into the shown order.

Constraints

  • 0 <= m, n <= 100000
  • 1 <= m + n
  • nums1.length = m + n
  • -10^9 <= value <= 10^9

More Atlassian Online Assessment questions

  • Planning ProductionOA · Seen Feb 2025
  • K-Means ClusteringOA · Seen Feb 2025
  • Minimum Sorted Erasure OperationsOA · Seen Jun 2024
  • Count Analogous ArraysOA · Seen Mar 2024
  • Get Maximum ScoreOA · Seen Mar 2024
  • Better Compression 🦀OA · Seen Mar 2024
  • Romanizer 🐡OA · Seen Mar 2024
  • Flower Bouquets 💐OA · Seen Mar 2024
  • Binary Search Tree IteratorOA · Seen Nov 2023
  • Binary Tree Level Order TraversalOA · Seen Nov 2023

Similar questions at other companies

  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Meandering ArrayVerisk · OA
  • Count Cross-Array Target-Sum PairsVisa · OAVisa interview questions
  • Can Every Package Fit in a BoxIMC Trading · OAIMC Trading interview questions
  • Minimum Tunnel Crossing TimeArcesium · OAArcesium interview questions
  • Merge 2 ArraysIBM · OAIBM interview questions
  • Get Maximum PairsAmazon · OA
  • Merge 2 ArraysOracle · OAOracle interview questions
  • Find Maximum GreatnessTwilio · OATwilio interview questions
  • Binge WatchingVanguard · OAVanguard interview questions

Atlassian interview experiences

  • Atlassian MLE Phone Screen: Model Deployment Design: 1 Experience
  • Atlassian Coding Screens and Karat: 3 Experiences (Part 2 of 2)
  • Atlassian Full Stack Interviews: 11 Experiences (Part 1 of 2)
All Atlassian interview questionsSee Atlassian hiring insights
Saved
class Solution {
    public int[] mergeSortedArray(int[] nums1, int m, int[] nums2, int n) {
      // Write your code here.
    }

}
Checking account…