Microsoft interview question

Arranging a list optimally .