Wiley interview question

Gave a coding assignment to do.