Pergunta de entrevista da empresa Penn State

How would you solve this problem?