Fora interview question

Simple array sort with memory allocation considerations.