Mphasis Interview Question

Have been asked to write a code for * pattern