John Deere interview question

Basic questions regarding some sorting techniques and few puzzles.