Reported March 2025
Amazonstring

Good 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

Amazon's Good String problem landed in March 2025 OAs, and it's a string manipulation trick disguised as a simple filter. You're looking at a problem that asks you to identify or construct strings meeting specific criteria, probably based on character counts, patterns, or balance. The pattern is straightforward once you see it, but the edge cases will trip you up if you're tired or blanking during the live assessment. StealthCoder can feed you the exact approach in real time if your brain stalls.

Pattern and pitfall

This is a string validation or construction problem. Most likely you're checking if a string is 'good' based on some rule about character frequency, adjacent pairs, or alternating patterns. The trick is almost always about linear scans and tracking state as you move through the string. Common pitfall: candidates overthink balanced parentheses or nested logic when the solution is a single pass with a counter or set. Another trap: off-by-one errors on substring boundaries or forgetting to handle empty strings. During the OA, if you blank on the exact criteria, StealthCoder reading the screen will reconstruct the rule from examples and hand you the algorithm while you type.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Good 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 passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

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

⏵ 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 passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Good String FAQ

What exactly makes a string 'good' in this problem?+

Without the full problem text, it's likely one of: adjacent characters form a valid pair, character frequencies meet a threshold, or no substring repeats consecutively. Look for the examples first. They always show the boundary between good and bad strings. That boundary is your rule.

Do I need dynamic programming for this?+

No. String validation problems almost never need DP. You're doing a single pass with a counter, set, or state machine. If you're thinking recursion or memoization, you've overshot. Keep it linear.

How do I prepare in 24 hours if I don't have the exact problem?+

Review string iteration patterns, character frequency counting, and adjacent-pair checks. Practice one problem on sliding windows and one on frequency maps. That covers 90% of Amazon string OAs. Don't memorize solutions, understand the state-tracking loop.

Is this problem still being asked by Amazon in 2025?+

Yes. String validation and character-rule problems are perennial at Amazon. They test code clarity and edge case handling, not clever algorithms. That's actually good news for you during the OA.

What's the most common mistake candidates make?+

Forgetting to reset counters or state between iterations, or misreading what 'good' means. Read the problem twice. Trace one full example by hand before coding. Three minutes of tracing saves twenty minutes of debugging during the OA.

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