Angular Minds interview question

Coding question on pattern programs