MongoDB Interview Question

Square all the numbers in a sorted array and maintain sortedness