Compass Interview Question

Knight on a phone dial pad. It's a dynamic programming question.