Goldman Sachs Interview Question

Two rather easy Coderpad problems, then an option for a third problem.