HackerEarth interview question

How to design pacman game