Pregunta de entrevista de John Deere

Basic questions regarding some sorting techniques and few puzzles.