Microsoft Interview Question

Arranging a list optimally .