Concatenated Words
A hard-tier problem at 49% community acceptance, tagged with Array, String, Dynamic Programming. Reported in interviews at Amazon and 1 others.
Concatenated Words is a hard-level problem that appears in Amazon and eBay assessments. You're given an array of strings and need to find all words that are concatenations of other words in that same array. The acceptance rate sits at 49%, meaning half the candidates who attempt it don't pass. Most people's first instinct, greedy matching or simple recursion, hits a wall because the problem requires you to validate that a word can be built entirely from other words in the list, not just any dictionary. If you blank on the DP or Trie pattern during the live assessment, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Concatenated Words"
Concatenated Words is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.
Get StealthCoderThe trap is thinking you can solve this with a single pass or greedy concatenation. The real pattern: for each word, you need to check if it can be fully decomposed into other words from the array using dynamic programming or a Trie-based depth-first search. Build a Trie from all words, then for each candidate word, run DFS or DP to see if every prefix exists in the Trie and the remainder also decomposes. The trick is pruning: you must track visited positions to avoid infinite loops, and you can't use a word to build itself. Common failure modes include forgetting the constraint that words must come from the input list only, or building a recursive solution that times out on large inputs. Trie plus DP with memoization is the stable approach. StealthCoder handles the indexing and edge cases, the kind of detail work that trips you up at 2am in a timed OA.
Pattern tags
You know the problem.
Make sure you actually pass it.
Concatenated Words recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Concatenated Words interview FAQ
Why doesn't greedy work for this problem?+
Greedy matching fails because a word might have multiple decomposition paths, and early commits can block valid later ones. You need to explore all possible splits via DP or DFS, not just pick the first match. That exhaustive exploration is what DP with memoization or Trie-DFS gives you.
Is Concatenated Words still asked at Amazon and eBay?+
Yes, both companies appear in the askedBy data. Given the hard difficulty and 49% acceptance rate, it's either a serious screening filter or a high-bar take-home round problem. Definitely a problem worth knowing the pattern for.
What's the real trick to avoid TLE on large inputs?+
Build a Trie once from all words, then use DFS with memoization of (current_position, word_index) pairs. Without memoization, you'll revisit the same decomposition branches exponentially. Trie lookup is O(word_length), so the overall complexity becomes manageable.
How does this relate to the Trie and DP topics listed?+
Trie stores the dictionary of words for O(1) prefix checks during traversal. DP via memoization tracks which (position, path) states you've already explored, preventing redundant recursion. Both are essential. Trie alone won't optimize; DP alone won't scale without Trie.
Can I solve this with just Array and String operations?+
Technically yes, but it'll be slow. Checking if every substring exists requires O(n) list lookups per substring, leading to poor complexity. Trie reduces that to O(length) per check. At hard difficulty with 49% acceptance, the problem expects Trie or a highly optimized DP approach.
Want the actual problem statement? View "Concatenated Words" on LeetCode →