Make String Anti-palindrome
A hard-tier problem at 42% community acceptance, tagged with String, Greedy, Sorting. Reported in interviews at Intuit and 0 others.
Make String Anti-palindrome is a hard problem that only about 42% of submissions pass. Intuit has asked it. You're given a string and need to rearrange it so no character at position i equals the character at position n-1-i. The trick isn't obvious on first read. Most candidates either try a greedy swap that gets stuck or don't realize Counting Sort insight solves it cleanly. If this problem hits your live assessment and you blank on the pattern, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Make String Anti-palindrome"
Make String Anti-palindrome 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 a senior engineer who knows the OA is theater. This is the script.
Get StealthCoderThe anti-palindrome constraint means you can't have matching characters mirrored across the string's center. A naive greedy approach of comparing and swapping fails because you can paint yourself into a corner. The key insight is Counting Sort framing: sort characters by frequency, then place them strategically so no mirror pair matches. Greedy placement works once you know the ordering. Most candidates miss that you need to count characters first, then construct intelligently rather than react to conflicts. When you hit this live and the obvious swap logic doesn't work, StealthCoder runs invisibly during screen share and shows the frequency-based construction pattern that passes all cases.
Pattern tags
You know the problem.
Make sure you actually pass it.
Make String Anti-palindrome 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 a senior engineer who knows the OA is theater. This is the script. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Make String Anti-palindrome interview FAQ
Is Make String Anti-palindrome actually asked at FAANG or mid-market companies?+
Intuit has reported it. It's hard tier, so it shows up in senior/mid-level loops, not entry-level tracks. The 42% pass rate suggests it's not a warmup. If you see it on your OA, treat it as a serious algorithmic problem, not a string manipulation toy.
What's the trick that makes this problem hard?+
The trap is thinking locally. A greedy swap approach gets stuck because fixing one mirror pair can create conflicts elsewhere. The real solution counts character frequencies first, then constructs the result using a Greedy + Sorting pattern. Most candidates discover this too late during the OA.
How does Counting Sort relate to solving this?+
Counting Sort isn't the final answer, but its mindset is. You count character frequencies, then place characters in a specific order to guarantee no mirror positions match. This approach is deterministic and avoids the dead-end of local greedy swaps.
Can I solve this with pure Greedy logic?+
Not cleanly. Greedy comparisons and swaps fail because the string can reach a state where no valid move exists. You need to pre-sort by frequency or position strategy before making placement decisions. That's why Sorting is listed as a core topic.
If I get stuck on this during an OA, how much time should I spend before moving on?+
Hard problems at 42% pass rate usually take 25-40 minutes for a solid solution. If you're stuck in local greedy logic after 15 minutes, pivot to frequency-counting and construction. If it's still stuck after 30, move on and come back. StealthCoder is your safety net for this exact scenario.
Want the actual problem statement? View "Make String Anti-palindrome" on LeetCode →