Amazon interview question

I don't remember precisely but it was based on merge sort algorithm