Pergunta de entrevista da empresa Rippling

How would you design a chess algorithm? Skip the initialisation bits but how would you design legal moves?