Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Quicksort by Hand
00:00
5 left

Quicksort by Hand

MediumPython

Problem

Implement quicksort by hand.

Asked in the round 3 (coding) stage. Implement the algorithm without calling Python's built-in sorting functions.

Contract

Define quicksort(nums), where nums is a list of integers. Sort the list in place and return the same list. Empty and single-element lists are valid.

Constraints

  • 0 <= len(nums) <= 1000
  • -10^9 <= nums[i] <= 10^9
  • The list must be sorted in place
  • Do not call built-in sorting functions

Function Signature

def quicksort(nums):
Interviewer

Your question is Quicksort by Hand. 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.