Leica Microsystems interview question

During the technical test I was asked to write a small program to solve a problem.