Wordle Feedback
Reported by candidates from EvenUp's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
The edge case that breaks a naive solution in this EvenUp Wordle Feedback question, reported in July 2025, is mixing up 'right letter, wrong spot' with 'letter missing'. Check positions first or you'll mislabel a G as a Y. The setup is friendly: both strings have distinct uppercase letters, so the duplicate-letter mess from real Wordle never shows up. It's a string and hash-table problem, and a calm candidate finishes it in minutes. If you blank on the OA, StealthCoder runs invisibly on your desktop and hands you the working solution in real time. Here's the script.
The problem
The uppercase strings answer and guess have equal length and contain no repeated letter within either word. Return one feedback character per guess position: G when the letter and position match, Y when the letter occurs elsewhere in answer, and _ when the letter is absent. Function wordleFeedback(answer: String, guess: String) → String Examples Example 1 answer = "ABCD" guess = "ACDE" return = "GYY_" A is exact, C and D are present at other positions, and E is absent. Example 2 answer = "PHONE" guess = "HOWLS" return = "YY___" H and O occur in the answer but both are misplaced. Example 3 answer = "PHONE" guess = "WALKS" return = "_____" No guessed letter occurs in the answer. Constraints 1 <= answer.length == guess.length <= 26. Both strings contain distinct uppercase English letters.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick is that distinct letters kill the hard part. No double-counting, no greens-first bookkeeping. Build a set (or a 26-slot lookup) from answer. Then walk guess by index. If guess[i] equals answer[i], write G. Else if guess[i] is in the set, write Y. Otherwise write _. That's O(n) time and O(1) space since the alphabet caps at 26. The common pitfall is overengineering: people port the full Wordle algorithm with frequency counts and two passes, then introduce bugs. Another slip is using answer.indexOf inside the loop, which works but is needlessly quadratic. Check Example 2 by hand: HOWLS against PHONE gives H and O present but misplaced, so YY___. If you freeze during the live OA, StealthCoder is the safety net that reads the problem on screen and gives you this loop, so you can submit and move on.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Wordle Feedback cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass EvenUp's OA.
EvenUp reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Wordle Feedback FAQ
How hard is the EvenUp Wordle Feedback question really?+
Easy. The distinct-letters constraint removes the duplicate handling that makes real Wordle tricky. It's one pass over the guess with a membership check. The only real risk is overthinking it or testing G before Y in the wrong order.
What's the trick to Wordle Feedback?+
Put answer's letters in a set, then loop through guess by index. Exact index match gives G, set membership gives Y, otherwise _. Check the exact match first so a correctly placed letter never gets labeled Y.
Do I need to handle repeated letters?+
No. The constraints say both strings contain distinct uppercase letters, so each letter appears at most once per word. Skip frequency counting and two-pass logic. Writing it anyway just adds places for bugs to hide.
What's the time and space complexity?+
Time is O(n) for one pass over guess, plus O(n) to build the lookup from answer. Space is O(1) in practice since the alphabet is 26 letters, or O(n) if you count the output string. Either answer is fine to state.
How do I prepare for this in 48 hours?+
Write it from scratch once and test the three examples by hand. Then practice a few similar string and hash-set problems for speed. This is a warm-up-tier question, so clean code and edge cases like length 1 matter more than cleverness.