← Google Interview Insights

Google·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Phone screen for a Google SWE role, one coding problem the whole time. It was a Wordle-style puzzle with a real algorithmic twist, not just grind-leetcode stuff, which I appreciated even if I fumbled parts of the follow-up.

Questions Asked (2)

Q1

You have a hidden 5-letter word and a black-box oracle that takes a position and a letter, returning true if that letter is at that position. Design an algorithm to identify the word while minimizing the total number of oracle calls. No dictionary available.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

My first instinct was just brute force, 5 positions times 26 letters, 130 calls worst case.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the oracle's behavior and constraints, then design an algorithm that systematically tests each position with each possible letter, using the oracle's binary feedback to eliminate possibilities. Optimize by leveraging the fact that each position has 26 possible letters, and consider information-theoretic lower bounds and adaptive strategies to minimize calls.

Pro tip: Mention that the naive approach of testing all 26 letters per position requires 130 calls, but you can reduce this by using a binary search-like strategy if the oracle supports it, or by noting that the last letter is determined by elimination, saving calls.

1. Clarify the problem

Ask clarifying questions: Is the oracle deterministic? Can we query the same position-letter pair multiple times? Are there constraints on the alphabet (e.g., lowercase English letters)? Is the word guaranteed to be in a known language?

2. Naive approach

For each of the 5 positions, test all 26 letters until the oracle returns true. This takes at most 5 * 26 = 130 calls, but on average 5 * 13.5 = 67.5 calls if letters are uniformly distributed.

3. Optimization via elimination

After determining 4 positions, the 5th position can be deduced by elimination if we know the word must be a valid English word, but since no dictionary is available, we cannot assume that. However, if the word is arbitrary, we still need to test the last position, but we can stop early once we find the correct letter for each position.

4. Information-theoretic lower bound

Each oracle call returns a binary answer, so it provides at most 1 bit of information. The total number of possible 5-letter words is 26^5 ≈ 11.9 million, requiring at least log2(26^5) ≈ 23.5 bits, so at least 24 calls are needed. However, the oracle only answers about a specific position and letter, so the lower bound may be higher.

5. Adaptive strategy

Design an adaptive strategy that chooses the next query based on previous answers. For example, use a decision tree where each node tests a position-letter pair, and branches based on the answer. The optimal strategy minimizes the worst-case number of calls, which can be found by dynamic programming or game theory.

Key Points to Mention

  • Clarify the oracle's interface and constraints (e.g., alphabet size, word length, whether the word is from a dictionary).
  • Naive approach: test each position with each letter, worst-case 130 calls, average 67.5 calls.
  • Optimization: stop testing a position once the correct letter is found; use elimination for the last position if possible.
  • Information-theoretic lower bound: at least 24 calls because each call gives 1 bit and there are 26^5 possibilities.
  • Adaptive strategies can reduce the number of calls by choosing queries that maximize information gain.
  • Trade-offs: worst-case vs. average-case performance, and the impact of assumptions about the word distribution.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Now assume you have a dictionary of valid 5-letter words. How would you redesign the strategy to use that information and reduce expected oracle calls further?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where it got interesting and also where I started to sweat a little.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain that with a known dictionary, you can precompute the set of possible words and use information theory to choose guesses that maximize expected information gain, such as minimizing the expected number of remaining candidates. Describe how to implement this efficiently, possibly using entropy or minimax, and discuss trade-offs between precomputation and runtime.

Pro tip: Mention that you can precompute an optimal decision tree or use a greedy entropy-based approach, and note that the first guess can be chosen to maximize information over the entire dictionary, often yielding a significant reduction in expected guesses.

1. Define the problem and constraints

Clarify that the goal is to minimize expected oracle calls given a fixed dictionary of valid 5-letter words. Assume the oracle provides feedback in the form of letter-color patterns (e.g., green, yellow, gray).

2. Model the information gain

For each possible guess, compute the expected information gain (e.g., entropy) over the remaining candidate words. The guess that maximizes expected information gain is optimal in a greedy sense.

3. Implement the strategy

At each step, filter the candidate set based on the oracle's feedback, then select the next guess from the full dictionary (or candidate set) that maximizes expected information gain. Consider precomputing a decision tree for all possible feedback patterns to reduce runtime.

4. Analyze trade-offs

Discuss trade-offs between precomputation time and runtime efficiency, and between greedy and optimal strategies. Mention that the first guess can be chosen to maximize information over the entire dictionary, often yielding a significant reduction in expected guesses.

5. Evaluate performance

Estimate the expected number of guesses using simulation or theoretical bounds, and compare with the previous strategy to demonstrate improvement.

Key Points to Mention

  • Use of information theory (entropy) to measure expected information gain.
  • Precomputation of an optimal decision tree or greedy selection at runtime.
  • Filtering candidate words based on feedback patterns.
  • Trade-offs between precomputation and runtime, and between greedy and optimal strategies.
  • Choice of first guess to maximize information over the entire dictionary.
  • Potential reduction in expected number of guesses compared to a naive strategy.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.