Capgemini interview question

to write a program to print a square pattern