Bloomberg interview question

I was not very confident to implement a sorting algorithm, so I just write a bubble sort.