Reported August 2024
Googlestring

Find Palindromes

Reported by candidates from Google's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Google OA. Under 2s to a working solution.
Founder's read

Google's August 2024 OA included a palindrome detection problem, and it's the kind of question that looks deceptively simple until you realize the edge cases will kill you. You've probably seen palindrome checks before, but this one likely adds a twist: substring search, character filtering, or a constraint on what counts as valid input. The core pattern is string manipulation with either two-pointers or hash-based validation. StealthCoder will be your safety net if you blank on the exact algorithm during the live assessment.

Pattern and pitfall

Palindrome problems at Google usually aren't about brute force. They test whether you can recognize the two-pointer pattern and handle edge cases: empty strings, single characters, mixed case, non-alphanumeric characters, or substring-based checks. The trick is knowing when to clean the input first versus checking in-place. Most candidates either over-complicate with extra space or miss that valid palindromes have symmetric structure around a center (odd-length) or between two middle characters (even-length). If you freeze on the exact implementation, StealthCoder reads the problem on screen and delivers the pattern instantly, so you can code without guessing.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Find Palindromes 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 for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as valid palindrome. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Google's OA.

Google reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Find Palindromes FAQ

Do I need to ignore spaces, punctuation, or case?+

The problem text would specify. If it doesn't say, assume you check only alphanumeric characters. Google often hides this requirement in the examples, not the description. Look at the test cases first.

Is this asking for a yes/no answer or to find all palindromes?+

If the title is 'Find Palindromes' plural, you're probably extracting or counting substrings. If it's 'Is Palindrome' singular, it's a boolean. The title here suggests multiple, so expect substring or character-filtering logic.

What's the time complexity trap?+

Checking every substring is O(n^3). Most candidates do that first. The real solution is O(n^2) with expand-around-center or O(n) with Manacher's algorithm. Google expects the linear approach for large strings.

Can I use a hash table or do I need two pointers?+

Two-pointers is cleaner for boolean checks. Hash tables work for frequency-based problems (e.g., can you rearrange to form a palindrome). Read the exact ask. Both are valid if the problem allows.

How do I prepare in 48 hours?+

Drill the two-pointer template and Manacher's algorithm once. Understand the expand-around-center trick. Write out three examples: odd-length, even-length, no palindrome. That covers 90% of what Google tests.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Google.

OA at Google?
Invisible during screen share
Get it