Pergunta de entrevista da empresa Shell

Generic but logical solutions needed