Pergunta de entrevista da empresa RadiSys

Got one puzzle to test my problem solving skills.