FastPrepWordle Guess Loop
Problems/Wordle Guess Loop

Wordle Guess Loop

Retool logoRetool● MediumFULLTIMENEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Retool phone-screen report dated May 20, 2024 describes a third Wordle task. You receive a dictionary, a starting word, and the answer. You repeatedly use the earlier consistency function, remove guesses already made, and return the number of guesses. Our version is about 94% the same as the reported question.

Every supplied uppercase word has the same length and contains no repeated letters. Start with start and repeatedly make Wordle guesses until you reach answer.

After each wrong guess, compute G, Y, and _ feedback against the answer. Choose the lexicographically smallest unvisited dictionary word that would produce exactly that feedback if it were the answer. Remove each chosen word from future consideration.

Return the number of guesses including the starting guess, or -1 if no unvisited consistent word remains.

Function

countWordleGuesses(words: String[], start: String, answer: String) → int

Examples

Example 1

words = ["ABCD","ACBE","AEBC"]start = "ABCD"answer = "AEBC"return = 3

Feedback GYY_ first selects ACBE, then the next feedback selects AEBC.

Example 2

words = ["PHONE","HPABC","APBHC"]start = "PHONE"answer = "APBHC"return = 2

APBHC is the smallest unvisited word matching the observed feedback.

Example 3

words = ["START"]start = "START"answer = "START"return = 1

The starting word is already the answer.

Constraints

  • 1 <= words.length <= 2000.
  • 1 <= words[i].length == start.length == answer.length <= 26.
  • Every word contains distinct uppercase English letters.
  • answer occurs in words.

More Retool interview questions

  • Maximum Profit with Exactly One Stock TransactionPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Order Sources by Their DependenciesPHONE SCREEN · Seen Oct 2026
  • Execute In-Memory SQL QueriesPHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2026
  • Maximum Profit with Exactly Two Stock TransactionsPHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2026
  • Next Consistent Wordle GuessPHONE SCREEN · ONSITE INTERVIEW · Seen Jun 2024
  • Wordle FeedbackPHONE SCREEN · ONSITE INTERVIEW · Seen Jun 2024
  • Markov Transition Counts and ProbabilitiesONSITE INTERVIEW · Seen Mar 2026

Similar questions at other companies

  • Credit Card Command ProcessorChime · PHONE SCREEN
  • Aggregate Paginated Project Run RecordsReplit · OA
  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • Merge Weekday and Time IntervalsNextdoor · PHONE SCREENNextdoor interview questions
  • Determine the Winner of Three-Card HandsOpenAI · PHONE SCREENOpenAI interview questions
  • Pins Violation Log QueriesPinterest · PHONE SCREENPinterest interview questions
  • Group AnagramsWorkday · PHONE SCREEN
  • Deterministic Secret Santa AssignmentShopify · PHONE SCREENShopify interview questions
  • Shortest-Job-First Process SchedulingByteDance · PHONE SCREENByteDance interview questions
  • Load/Store Arithmetic InterpreterJane Street · PHONE SCREENJane Street interview questions
All Retool interview questionsSee Retool hiring insights
Saved
class Solution {
    public int countWordleGuesses(String[] words, String start, String answer) {
        // Write your code here.
    }
}
Checking account…