Persistent Systems Interview Question

In Technical interview , I had to solve pattern coding.