Pregunta de entrevista de RadiSys

Got one puzzle to test my problem solving skills.