Cognizant interview question

Prepare basic programs and pattern printing