Reported August 2026
Bloombergtwo pointers

Valid Palindrome II

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

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

The mistake that sinks most first attempts at Valid Palindrome II is deleting a character greedily and moving on. Bloomberg reported this one in August 2026, and it's a clean two-pointers problem with one trap. You have an OA coming, so you need the trick, not a lecture. Check whether s is a palindrome after deleting at most one character, with strings up to 10^5 long. The logic is short, but it's easy to blank on the branch. StealthCoder sits invisibly on your screen during the live OA as a safety net if your mind goes empty on the mismatch case.

The problem

Given a string s, return true if it can become a palindrome after deleting at most one character. Otherwise, return false.

Function
validPalindrome(s: String) → boolean

Examples
Example 1
s = "aba"
return = true
The string is already a palindrome, so no deletion is needed.
Example 2
s = "abca"
return = true
Deleting b or c leaves a palindrome.

Constraints
1 <= s.length <= 10^5
s contains only lowercase English letters.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Start with pointers at both ends and move inward while characters match. At the first mismatch, you get exactly one deletion. Try both options: skip the left character or skip the right character, then check whether the remaining substring is a palindrome with a plain helper. Return true if either works. That's O(n) time and O(1) space. The pitfall is picking one side to skip, which fails on cases where the other side was the right call. Another slip is allowing a second deletion by recursing carelessly, which can blow up or give wrong answers. Keep the helper strict, with no further skips. With n up to 10^5, don't build substrings in a loop or try every deletion, since that's O(n^2). If you freeze on the two-branch check during the Bloomberg OA, StealthCoder can hand you the working version in real time.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Valid Palindrome II 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 StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

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

⏵ The honest play

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

Bloomberg 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.

Valid Palindrome II FAQ

What's the trick in Valid Palindrome II?+

Use two pointers from both ends. On the first mismatch, check two cases: skip the left character or skip the right one. For each, verify the rest is a strict palindrome. If either passes, return true. Trying only one side is the classic wrong answer.

How hard is this problem really?+

It's easy-level in concept but people still fail it. The two pointers part is simple. The failure is handling the mismatch properly. Once you remember to try both skips, it's about fifteen lines of code.

Why can't I just try deleting every character?+

Deleting each index and checking for a palindrome is O(n^2). With length up to 10^5, that's too slow. The two-pointer approach only branches once, at the first mismatch, so total work stays linear.

Is this pattern still asked by Bloomberg?+

It was reported in August 2026, so yes, it's showing up in recent Bloomberg OAs. Two-pointers on strings is a staple, so expect variants with similar mismatch-handling logic.

How do I prepare in 48 hours?+

Write this one from memory twice. Write a helper that checks a palindrome between indices i and j. Then write the main loop that calls it on both skip options at the first mismatch. Test on aba, abca, and a string needing right-side deletion.

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

OA at Bloomberg?
Invisible during screen share
Get it