Snowflake OA Hackerrank 3 coding question

snowflake logo
snowflake
May 18, 2026 · 0 reads

Summary

I completed Snowflake's 90‑minute HackerRank online assessment which contained three coding questions ranging from easy to medium‑hard, focusing on dynamic programming, string processing, greedy algorithms, and priority queues.

Full Experience

Snowflake Online Assessment as a 90‑minute HackerRank test with 3 coding questions, usually around Easy-Medium, Medium, and Medium-Hard difficulty. It says the main focus areas are dynamic programming, string processing, greedy algorithms, priority queues, and careful boundary-case handling. The article emphasizes that Snowflake OA questions often have long descriptions, strict edge cases, and high time pressure.

The high-frequency question types mentioned include Prime String Partition, which uses DP to count valid ways to split a numeric string into prime-number substrings; Text Scoring / Prefix Match Score, which can be optimized with KMP or prefix matching; Constrained Vowel Strings, a DP problem counting strings with limited consecutive vowels; Task Scheduling with Constraints, usually solved with sorting plus a priority queue; and String Rotation Check, where the classic trick is checking whether target appears in src + src.

For preparation, the article recommends focusing heavily on DP counting problems and state compression, practicing string algorithms like KMP, and doing full 90‑minute HackerRank‑style mock tests. It also suggests time allocation: finish the first problem in about 20 minutes, spend 25–30 minutes on the second, and leave enough time for the hardest third problem. Boundary cases such as empty strings, single characters, leading zeros, repeated characters, and overlap cases are highlighted as especially important.

Interview Questions (5)

1.

Prime String Partition

Data Structures & Algorithms

Given a numeric string, count the number of valid ways to split it into substrings where each substring represents a prime number. The solution typically uses dynamic programming to explore all possible partitions and check primality of each segment.

2.

Text Scoring / Prefix Match Score

Data Structures & Algorithms

Given two strings, compute a score based on prefix matches. The problem can be optimized using the Knuth-Morris-Pratt (KMP) algorithm or other prefix‑matching techniques to efficiently calculate the score for all possible prefixes.

3.

Constrained Vowel Strings

Data Structures & Algorithms

Count the number of strings of a given length that contain at most a certain number of consecutive vowel characters. This is a dynamic programming problem that tracks the number of consecutive vowels used so far.

4.

Task Scheduling with Constraints

Data Structures & Algorithms

Given a set of tasks with constraints (e.g., cooling periods or dependencies), schedule the tasks to minimize total execution time. The typical solution involves sorting the tasks and using a priority queue to select the next executable task.

5.

String Rotation Check

Data Structures & Algorithms

Determine if one string is a rotation of another. The classic solution checks whether the target string appears as a substring of the source string concatenated with itself (src + src).

Preparation Tips

The article recommends focusing heavily on DP counting problems and state compression, practicing string algorithms like KMP, and doing full 90‑minute HackerRank‑style mock tests. It also suggests allocating about 20 minutes for the first problem, 25‑30 minutes for the second, and reserving the remaining time for the hardest third problem, while paying close attention to edge cases such as empty strings, single characters, leading zeros, repeated characters, and overlap scenarios.

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!