Pergunta de entrevista da empresa Google

Nothing unexpected. Make use of "cracking the coding interview" book.