HackerEarth Interview Question

How to design pacman game