Yamaha interview question

Sorting and concatenation without inbuilt functions