John Deere Interview Question

Basic questions regarding some sorting techniques and few puzzles.