Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Array Sorting Implementation
00:00
5 left

Array Sorting Implementation

EasyPython

Problem

Airbus Americas Customer Services processes numeric identifiers such as aircraft part references and maintenance event codes. Given an array of integers, return a new array containing the same values in nondecreasing order.

Implement the sorting algorithm yourself. Do not call Python's built-in sort() or sorted() functions. After implementing the function, explain why you selected the algorithm and state its time and space complexity.

Formal Specification

  • Input: nums, a list of integers. The list may be empty and may contain duplicate or negative values.
  • Output: A new list containing all values from nums in nondecreasing order.
  • The input list should not be modified.

Constraints

  • 0 <= len(nums) <= 10^4
  • -10^9 <= nums[i] <= 10^9
  • Duplicate values are allowed
  • The input list must remain unchanged

Function Signature

def sort_numbers(nums):
Interviewer

Your question is Array Sorting Implementation. Start with the requirements in the Question tab.

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.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.