Promatics Interview Question

Basic java program like pattern