Rudder Analytics interview question

Logic for quick sort