Sam Media Interview Question

I was asked to refactor some code.