Capital One Interview Question

General case study involving refactoring