Pergunta de entrevista da empresa Intel Corporation

two logic questions and one programing question.