Microsoft Interview Question

A simple sorting problem