BAE Systems interview question

Writing pseudo-code.