Atlassian Interview Question

Snake game and algorithmic question