Another puzzle I had to solve during an interview.