HARDasked at 4 companies

Palindrome Pairs

A hard-tier problem at 36% community acceptance, tagged with Array, Hash Table, String. Reported in interviews at Airbnb and 3 others.

Founder's read

Palindrome Pairs hits different. You're given a list of words and asked to find every pair of indices where concatenating word[i] + word[j] forms a palindrome. Airbnb, Wix, Yandex, and Goldman Sachs have all asked it. The brute force check every pair approach will time out. Most candidates tank this one because the pattern isn't obvious until you've seen it or had time to think it through. If this lands in your live assessment and you freeze, StealthCoder runs invisibly and surfaces the working solution in seconds. You won't have time to derive the trie trick on the clock.

Companies asking
4
Difficulty
HARD
Acceptance
36%

Companies that ask "Palindrome Pairs"

If this hits your live OA

Palindrome Pairs 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 Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.

Get StealthCoder
What this means

The trick is a Trie paired with reverse-string lookups. Build a trie of reversed words, then for each word, walk the trie forward and check at each node whether the remaining suffix is itself a palindrome. If it is, you've found a match. Most people start with hash tables and nested loops, which fails on large inputs. Others try to precompute all palindromes and cross-reference. Both are dead ends. The acceptance rate sits at 36%, which reflects that this problem demands either prior exposure to the trie-based pattern or significant time to think. The topics span Array, Hash Table, String, and Trie, but only the Trie approach scales. When you hit this live and the straightforward idea doesn't work, StealthCoder bypasses the derivation and hands you the solution.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Palindrome Pairs 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 Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Palindrome Pairs interview FAQ

Why does the brute force approach fail?+

Checking every pair and running a palindrome check on each concatenation is O(n^2 * m), where n is the list length and m is average word length. On lists with even 500 words, you'll timeout. The problem setter expects sub-quadratic logic.

Is this still asked at Airbnb and Goldman Sachs?+

Yes, all four named companies in the data have reported it recently. The 36% acceptance rate shows it's not a warm-up question. Expect it at mid-to-senior IC rounds or at companies screening for strong string and tree data structure chops.

What's the Trie-based pattern everyone talks about?+

Build a Trie of reversed words indexed by original position. For each word, traverse the Trie forward and at each position check if the remaining characters form a palindrome. If yes, the pair is valid. This cuts the check down to O(m^2) per word, making total complexity manageable.

How does the Hash Table topic fit in?+

Some solutions use a hash map to store word-to-index mappings and filter candidates before the palindrome check. It's an optimization layer, not the core logic. The Trie is what makes this problem hard.

What's the most common mistake?+

Forgetting that empty strings or zero-length words can be valid pairs with any palindrome. Also, confusing Trie construction direction (forward vs. reversed words) tanks a lot of implementations. Off-by-one errors in palindrome boundary checks are rife.

Want the actual problem statement? View "Palindrome Pairs" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.