Goldman Sachs Interview Question

Some question regarding list reordering