IBM interview question

Complete code problems that they give you