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 11 problems of 100
- #31mediumfrequently asked
31. Add Two Numbers
Add two non-negative integers stored as linked lists in reverse-digit order. Snowflake asks this to test carry propagation logic — the same arithmetic kernel that underlies their high-precision NUMBER type's addition.
- #32mediumfrequently asked
32. Longest Substring Without Repeating Characters
Find the length of the longest substring with all distinct characters. Snowflake uses this to test sliding-window mastery — the same technique their executor uses for running-distinct window functions.
- #35mediumfrequently asked
35. 3Sum
Find all unique triplets that sum to zero. Snowflake uses this to test deduplication discipline at multiple levels — the same care needed when implementing DISTINCT inside GROUP BY queries on multiple columns.
- #41mediumfrequently asked
41. Search in Rotated Sorted Array
Search for a target in a sorted array that has been rotated at an unknown pivot. Snowflake asks this to test modified binary search reasoning — the same instinct used when indexing data that may be partially ordered due to micro-partition layout.
- #42mediumfrequently asked
42. Find First and Last Position of Element in Sorted Array
Find the first and last index of a target in a sorted array. Snowflake asks this to test lower_bound/upper_bound mechanics — the same primitive used to extract row ranges for a clustered-column predicate inside a micro-partition.
- #47mediumfrequently asked
47. Permutations
Generate all permutations of a distinct-integer array. Snowflake asks this to test backtracking with a used-mask — relevant for join-order enumeration where the planner permutes table orderings to find the optimal plan.
- #49mediumfrequently asked
49. Group Anagrams
Group strings that are anagrams of each other. Snowflake asks this to test composite-key grouping — the same hashing pattern used in GROUP BY execution where you bucket rows by a normalized key.
- #52mediumfrequently asked
52. Merge Intervals
Merge overlapping intervals. Snowflake asks this to test sort-then-sweep — the same primitive used to coalesce overlapping micro-partition ranges during clustering maintenance.
- #73mediumfrequently asked
73. Validate Binary Search Tree
Determine whether a tree is a valid BST. Snowflake asks this to test the global-constraint vs local-check distinction — same shape as validating cross-table constraints during schema changes.
- #77mediumfrequently asked
77. LRU Cache
Design an LRU cache with O(1) get and put. Snowflake asks this constantly because it's the foundation of their warehouse cache — frequently-accessed micro-partitions stay hot in SSD; cold ones get evicted by exactly this policy.
- #79mediumfrequently asked
79. Coin Change
Find the minimum number of coins that sum to a target. Snowflake asks this as the canonical 1D unbounded-knapsack — relevant to choosing min-cost combinations of cached vs cold partitions.