Rudder Analytics Interview Question

Logic for quick sort