e-con Systems interview question

technical qn sort in asscending order using function