Pergunta de entrevista da empresa All On Block

Basic algorithm questions and few puzzles