ION Group interview question

Puzzles (mostly available on gfg)