QinetiQ interview question

How would you make this code better?