Getty Images interview question

Refactoring sloppy code