Goldman Sachs interview question

Easy to Medium level Dsa and SQL