MongoDB interview question

Simple sorting algorithm on a list.