Goldman Sachs interview question

mostly based on DSA Questions,.