Validate a Single-Letter Word Sequence
Reported by candidates from Reddit's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Reddit reported this one in September 2026, and the detail that matters is buried in the rules: every adjacent pair must differ at exactly one position, so a repeated word like dot to dot fails. It's a string scan, nothing fancy. If you're taking this OA in the next day or two, the risk isn't difficulty, it's missing an edge case under pressure. Empty arrays, single words, unequal lengths. If you blank mid-assessment, StealthCoder runs invisibly on your desktop and can hand you the solution live. Otherwise, read on and you won't need it.
The problem
Given an array of strings words, determine whether it forms a valid single-letter word sequence. The sequence is valid when every adjacent pair has the same length and differs at exactly one character position. A sequence with fewer than two words is valid. A word may appear again later in the sequence, as long as each adjacent transition still changes exactly one character. Function isValidWordSequence(words: String[]) → boolean Examples Example 1 words = ["hot","dot","cog"] return = false hot to dot changes one position, but dot to cog changes two. Example 2 words = ["hot","dot","dot"] return = false The final transition changes zero positions, but every adjacent pair must change exactly one. Example 3 words = ["hot","dot","dog"] return = true Each adjacent pair has length three and changes exactly one character. Constraints 0 <= words.length <= 100000. Every word contains only lowercase English letters. The total number of characters across all words is at most 200000.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick is that there's no trick. Loop i from 1 to n-1, compare words[i-1] and words[i]. If lengths differ, return false. Count positions where characters differ. If the count isn't exactly 1, return false. If you finish the loop, return true. Arrays with fewer than two words skip the loop and return true automatically. The common pitfall is treating this like Word Ladder and building a graph or hunting for a path. You don't need that. You're only validating a given sequence. Another miss is allowing a zero-difference transition, which Example 2 explicitly rejects. Total characters are capped at 200000, so a single pass is linear and fits easily. You can break early once the diff count passes 1. If the clock gets to you on the live OA, StealthCoder is the hedge that gets the loop written correctly, but this fits in about ten lines.
If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.
You can drill Validate a Single-Letter Word Sequence 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 passed his OA cold and still thinks the filter is broken.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Reddit's OA.
Reddit reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Validate a Single-Letter Word Sequence FAQ
How hard is the Reddit single-letter word sequence question really?+
Easy. It's a linear scan over adjacent pairs with a character diff count. The only real danger is sloppy edge cases: empty input, one word, mismatched lengths, and identical neighbors. If you handle those four, you're done in a few minutes.
What's the trick to this problem?+
There isn't one beyond reading carefully. Each adjacent pair needs equal length and exactly one differing position. Zero differences is invalid, two or more is invalid. Don't build a graph or run BFS, because the sequence is already given to you.
Do duplicate words break the sequence?+
Only when they're adjacent. The same word can show up later, like hot, dot, hot, as long as each transition changes exactly one character. Adjacent duplicates give zero differences, so the answer is false, as Example 2 shows.
What's the time complexity I should state?+
O(total characters), which is at most 200000 here. You compare each adjacent pair once, and each comparison costs the word length. Extra space is O(1) since you only keep a diff counter. Early exit when the count exceeds one is a nice touch.
How do I prepare for this in 48 hours?+
Write the function from scratch twice, then test it against the three examples plus empty and single-word inputs. Practice a clean helper that counts differing characters and bails early. Spend the remaining time on other string-scan problems with similar edge case traps.