Capgemini Engineering Interview Question

Algorithm for chess game