Goldman Sachs interview question

Print the required pattern