D2L interview question

write the logic for array sorting and Array manipulation