Atlassian interview question

Snake game and algorithmic question