Pergunta de entrevista da empresa Super.com

how would you iteratively build this