Pergunta de entrevista da empresa Microsoft

For a given sentence, write down an effective algorithm to reverse each word in the sentence.