IBM Interview Question

Coding question related to sorting