Morgan Stanley interview question

I had to write a chess player program.