Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Implement Merge Sort

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Implement Merge Sort. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Given an array of integers, return a new array with the same values sorted in non-decreasing order. Implement the sort using merge sort and be ready to explain its time complexity.

Constraints

  • 1 <= nums.length <= 10^5
  • -10^9 <= nums[i] <= 10^9
  • Return a new sorted array
  • Target time complexity: O(n log n)
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output