Pergunta de entrevista da empresa Google

Design an algorithm to do X, then analyse the complexity.