Pergunta de entrevista da empresa Hexaware Technologies

Two questions about some random puzzles