String Patterns
Reported by candidates from Snowflake's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Snowflake ran a string pattern problem in January 2024, and it's the kind of thing that sounds simple until you're live and your brain goes blank. The OA will likely ask you to match, parse, or transform strings according to a rule. Most candidates overthink it. The trick is usually recognizing whether you need regex, character-by-character parsing, or a state machine. StealthCoder reads the problem in real time and surfaces the pattern instantly, so you're never guessing on the clock.
Pattern and pitfall
String pattern problems come in flavors: wildcard matching, regular expression validation, substring transformation, or character grouping. The common pitfall is trying to regex everything when a simple loop works, or vice versa. Snowflake leans toward problems that test your ability to handle edge cases like empty strings, special characters, or repeated patterns. The pattern usually becomes obvious once you map out a few test cases by hand. If you recognize it's a DP problem (like wildcard matching with * and ?), you'll know to build a 2D table. If it's simpler, a single pass with a pointer or index suffices. StealthCoder acts as your safety net if the problem statement is ambiguous or you blank on the exact algorithm.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill String Patterns 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 StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as wildcard matching. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Snowflake's OA.
Snowflake 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.
String Patterns FAQ
How do I know if this is regex or DP?+
If the problem mentions wildcards (*, ?), constraint matching, or backtracking, think DP with a 2D table. If it's pure regex validation, use a regex engine or simulate one with a state machine. Read the problem carefully for what characters are allowed as wildcards.
What's the most common edge case?+
Empty strings, strings with only wildcards, or patterns that match the empty string. Test those first. Also check if consecutive wildcards should collapse or be treated separately.
How long should this take?+
If it's a simple parse, 10-15 minutes. If it's wildcard matching with DP, 20-30 minutes to code and test. Snowflake's January batch didn't specify, so assume 30-45 minutes per question.
Can I use built-in string methods?+
Probably yes for splitting, case conversion, and basic searching. Regex libraries are often allowed. Check the problem statement or ask the proctor if the rules aren't explicit.
What if I don't recognize the pattern?+
Write a brute-force solution first. Then optimize. Most string patterns reduce to either iteration with pointers or dynamic programming. Start there and refine.