Pergunta de entrevista da empresa Meta

Small puzzles given as coding problems.