Example code I was asked to make for an interview