Pergunta de entrevista da empresa Hexagon

some logical reasoning question