Model the problem as an adaptive decision tree where each guess partitions the remaining candidate words based on the host's response. The minimum number of guesses is the depth of the optimal decision tree, which can be found by minimizing the maximum number of remaining candidates after each guess. Use information theory to lower-bound and search over possible letter guesses to find the exact minimum for the given word set.
Pro tip: Clarify that the host's adversarial switching means you must guarantee identification for all consistent words, so the strategy must be robust to worst-case responses. Mention that the answer depends on the specific set of words, and for small sets you can compute it via exhaustive search or dynamic programming.
Restate that words are distinct, equal length, lowercase, and the host can switch to any word consistent with all previous guesses. The goal is to minimize the worst-case number of guesses.
Each guess (a letter) partitions the current candidate set into subsets based on the host's response (which positions contain the letter, or absent). The worst-case number of guesses is the depth of the tree.
The number of possible responses to a guess is at most (length+1) possibilities (absent or appears in one of the positions). Thus, with k guesses, you can distinguish at most (length+1)^k words. So k >= ceil(log_{length+1}(N)).
For a given word set, search over possible letter guesses to minimize the maximum remaining candidates. Use recursion or dynamic programming to compute the exact minimum depth. For small sets, this is feasible.
Mention that the optimal strategy may not be unique, and that the problem is computationally hard for large sets. In an interview, focus on the modeling and lower bound, and if needed, propose a greedy heuristic.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.