Snowflake Coding Interview Questions
100 Snowflake coding interview problems with full optimal solutions — 30 easy, 50 medium, 20 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Snowflake interviewer values, and a FAQ section.
Showing 18 problems of 100
- #5easysometimes asked
5. Remove Element
Remove all instances of a target value from an array in-place. Snowflake uses this to test whether you can write a tight scan loop — the same shape as a predicate pushdown filter over a column chunk.
- #7easysometimes asked
7. Plus One
Given a big integer represented as a digit array, add one. Snowflake uses this to test edge-case rigor — the carry propagation is the same shape as overflow handling in their NUMBER(38,0) arithmetic kernels.
- #9easysometimes asked
9. Binary Tree Inorder Traversal
Return the in-order traversal of a binary tree. Snowflake asks this to test whether you can produce both the recursive and the iterative-with-stack solution — relevant because their B-tree-style indexes use ordered iteration for range scans.
- #10easysometimes asked
10. Same Tree
Determine whether two binary trees are structurally identical and have the same values. Snowflake asks this as a recursion warm-up before deeper tree problems, often paired with a structural-equality follow-up on query plans.
- #11easysometimes asked
11. Symmetric Tree
Determine whether a binary tree is a mirror of itself around its center. Snowflake asks this to test paired-pointer recursion — the same pattern used to check tree balance invariants in their on-disk index structures.
- #13easysometimes asked
13. Balanced Binary Tree
Decide whether a binary tree is height-balanced (every subtree's left/right heights differ by at most 1). Snowflake asks this to test whether you can fuse the 'check' and 'measure' passes into one — the same fusing the query planner does to avoid re-scanning data.
- #14easysometimes asked
14. Path Sum
Determine whether a root-to-leaf path sums to a target. Snowflake asks this to test recursion with a target accumulator — relevant for plan-cost rollup where each operator adds cost on the way up.
- #15easysometimes asked
15. Pascal's Triangle
Generate the first numRows of Pascal's triangle. Snowflake uses this to test row-at-a-time DP building — the same shape as windowing operations over a column where the next row depends on the previous one.
- #17easysometimes asked
17. Valid Palindrome
Determine whether a string is a palindrome considering only alphanumeric characters. Snowflake uses this to test two-pointer hygiene and Unicode-aware normalization — the same normalization pipeline that runs before COLLATE comparisons in their SQL engine.
- #19easysometimes asked
19. Linked List Cycle
Determine whether a linked list has a cycle using O(1) space. Snowflake asks this because Floyd's tortoise-and-hare is a textbook example of how to convert from O(n) to O(1) auxiliary space — a recurring theme in their constant-memory streaming kernels.
- #21easysometimes asked
21. Two Sum II - Input Array Is Sorted
Two-sum when input is already sorted, asking for the two indices. Snowflake uses this to test whether you exploit the sortedness — the same instinct a query planner uses to pick a merge-join over a hash-join when inputs are already sorted.
- #22easysometimes asked
22. Majority Element
Find the element appearing more than n/2 times. Snowflake asks this because Boyer-Moore voting is the canonical O(1)-space streaming algorithm — and similar sketch-based algorithms underpin their approximate aggregation functions.
- #23easysometimes asked
23. Rotate Array
Rotate an array to the right by k steps in-place. Snowflake asks this to test the reverse-three-times trick — an elegant O(1) space transformation that mirrors how their executor performs in-place reorderings on column chunks.
- #24easyrarely asked
24. Reverse Bits
Reverse the bits of a 32-bit unsigned integer. Snowflake asks this to test bit-manipulation fluency — relevant for compact column encodings where they sometimes pack rotated/reversed bits to align with vectorized SIMD masks.
- #25easysometimes asked
25. Number of 1 Bits
Count the number of 1 bits in an integer (popcount). Snowflake uses this to test bit-manipulation knowledge and to set up a follow-up on bitmap-index intersection — popcount is the hot loop in bitmap predicate evaluation.
- #26easysometimes asked
26. House Robber
Maximize loot from non-adjacent houses. Snowflake asks this as a 1D-DP warm-up before harder DP problems; the rolling-two-variable variant is also a model for incremental aggregation state.
- #27easyrarely asked
27. Happy Number
Determine whether repeatedly summing the squares of a number's digits eventually reaches 1. Snowflake uses this to test cycle detection in a function-iteration setting — relevant for recursive CTE termination analysis.
- #28easysometimes asked
28. Isomorphic Strings
Decide whether two strings are isomorphic — there's a one-to-one mapping between characters. Snowflake asks this to test bijection logic — the same shape used to validate schema-to-schema column mappings during data sharing.