TikTok interview question

How to use hash map to build a Pac-Man game.