Genesys interview question

Pattern printing code,Puzzles