Reported October 2024
Amazonstring

Special String

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

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

You've got an Amazon OA coming in the next 48 hours with a string manipulation problem called 'Special String.' This is the kind of question that looks simple on the surface but punishes you if you miss the pattern. Candidates report it as a string-focused puzzle where the trick isn't brute force. If you blank during the live OA, StealthCoder runs invisibly and reads the problem statement to give you the approach in real time. You won't need to guess.

Pattern and pitfall

The 'Special String' problem is almost certainly asking you to identify or validate a string property that repeats or alternates in a specific way. Common variations: check if characters appear in pairs, validate that a string reads the same forwards and backwards with some twist, or confirm that consecutive characters follow a rule. The gotcha is often an off-by-one error or missing edge case around single characters or empty strings. Most candidates overcomplicate it with nested loops when a single pass or hash count solves it. During the OA, if you freeze, StealthCoder will show you the exact pattern to check so you can code with confidence.

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 Special String 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

⏵ The honest play

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

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

Special String FAQ

What does 'special' usually mean in Amazon string problems?+

It means the string follows a specific rule about character distribution or arrangement. Often it's about pairs, alternation, or symmetry. Read the examples carefully. The definition is hidden there, not in the problem title.

Should I use a hash map or just iterate?+

If you're counting character frequencies, a hash map is clean. If you're checking patterns on the fly, a single pass with a flag or pointer works. Test both approaches mentally before coding. Amazon prefers clean, linear solutions.

How do I handle edge cases in 20 minutes?+

Write your main logic first. Then test: empty string, single character, two identical characters, alternating characters, all same character. Ask yourself: does my code break on any of these?

Is this a two-pointer problem?+

Possibly, if you're comparing a character from the start with one from the end. But it's more likely a hash-count or single-pass iteration. Don't assume complexity. Start simple.

What if I can't figure out the pattern in 10 minutes?+

Write a brute force check that tests all possible interpretations of 'special' you can think of. Then optimize. On the live OA, StealthCoder will prompt you with the exact definition if you're stuck.

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

OA at Amazon?
Invisible during screen share
Get it