Pergunta de entrevista da empresa Microsoft

Two coding questions they asked