Mphasis interview question

Have been asked to write a code for * pattern