AI & Technical question
If you were to write an algorithm to solve Hangman, what would that look like?
- AI & Technical
- Hard
Practice this question out loud. An AI interviewer asks it, follows up like a real interviewer would, and scores your answer. Type or speak.
Start a mock interview on this question · Mock interview from a job description
What this question tests
Tests basic algorithmic thinking for a PM: designing a simple strategy for a search-and-guess game using probability and information theory intuition, without needing formal code.
How to approach it
- Clarify the rules: a fixed word, a limited number of wrong guesses, and letters guessed one at a time, revealed if correct.
- Propose a starting strategy: guess the most frequent letters in the English language first (E, A, R, I, O, T) to maximize expected information gain.
- Refine using word length: use the number of blanks (word length) to narrow the space of plausible words and prioritize letters common in words of that length.
- Update after each guess: once some letters are revealed, use a frequency approach that considers letter patterns given the known positions (such as common bigrams or word structures).
- Consider expected information: at each step, pick the letter most likely to either confirm or eliminate the largest number of remaining plausible words, similar to a decision-tree pruning approach.
What a strong answer includes
- Grounds the strategy in letter frequency and information gain (choosing the guess that narrows the possibility space most), which is the actual optimal approach to Hangman.
- Explains how word length and revealed letters should update the guessing strategy over time, not just a fixed static letter order.
- Uses accessible language (expected information gain, narrowing the word space) rather than requiring literal code, appropriate for a PM-level technical question.
- Notes the algorithm could be implemented against a dictionary of valid words, filtering candidates after each guess, which is how real solvers work.
Common mistakes
- Proposing a fixed guessing order with no adaptation as letters are revealed.
- Ignoring word length and pattern information, which is one of the strongest signals available in Hangman.
Likely follow-up questions
- How would your approach change for a very short word versus a very long one?
- How would you turn this into code at a high level?
More ai & technical questions
- Design a simple load balancer for Google.com. What data structures would you use?Google · AI & Technical · Hard
- How does TinyURL work?Google · AI & Technical · Easy
- How would you explain cloud computing to your grandmother?Google · AI & Technical · Easy
- What happens when you enter a URL in your browser?Google · AI & Technical · Easy
- You’re part of the Google Search web spam team. How would you detect duplicate websites?Google · AI & Technical · Hard
- Explain the data pipeline for the last AI project you worked on. What were the top challenges in getting data, and how did you resolve them?Google · AI & Technical · Hard
More questions from Google
Learn the skill behind it
Chapters of the AI PM course that teach what this question tests.
- Chapter 1: Foundations: the model and the decisions it forces on you
- Chapter 8: Evals: define good and make the number defensible
- Chapter 6: Agents and agentic architecture