Philips interview question

Implement merge sort and quick sort, explain its working with an example