Goldman Sachs interview question

Several questions about programming and algorithms