Pergunta de entrevista da empresa Google

Two questions about searching and ordering lists.