Pergunta de entrevista da empresa Qualcomm

Given a sorted array that can have both negative and positive integers, write an algorithm to sort the array of the squares of the integers. Optimize it.