Problem database last updated: June 20, 2025

SSnowflake logo

Snowflake Coding Interview Questions

78 problems · 10 Easy, 45 Medium, 23 Hard · Ranked #32 of 458

Difficulty breakdown

10 Easy

13% · avg 23%

45 Medium

58% · avg 59%

23 Hard

29% · avg 18%

Top topics

array
51.3%
string
30.8%
hash-table
28.2%
depth-first-search
23.1%2.5x
dynamic-programming
17.9%
breadth-first-search
15.4%1.9x

Interview profile

Based on 78 reported problems, Snowflake interviews are significantly harder than average - 29% Hard vs 18% across all companies. The majority (58%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.

Compared to the industry average, Snowflake puts unusual emphasis on shortest-path (2.6% of problems, 5.1x the industry average), topological-sort (3.8% of problems, 3.3x the industry average), randomized (2.6% of problems, 2.8x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (51.3%), string (30.8%), hash-table (28.2%), depth-first-search (23.1%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 78 problems

Happy Number

Solve

Write an algorithm to determine if a number n is happy.

EasyVery Likely
hash-tablemathtwo-pointers

Minimum Window Substring

Solve

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is inc...

HardVery Likely
hash-tablestringsliding-window

Course Schedule II

Solve

There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, b...

MediumVery Likely
depth-first-searchbreadth-first-searchgraph

Find All Anagrams in a String

Solve

Given two strings s and p, return an array of all the start indices of p's anagrams in s. You may return the answer in any order.

MediumVery Likely
hash-tablestringsliding-window

Word Search II

Solve

Given an m x n board of characters and a list of strings words, return all words on the board.

HardVery Likely
arraystringbacktracking

String Transformation

Solve

You are given two strings s and t of equal length n. You can perform the following operation on the string s:

HardVery Likely
mathstringdynamic-programming

Step-By-Step Directions From a Binary Tree Node to Another

Solve

You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing...

MediumVery Likely
stringtreedepth-first-search

Calculate Amount Paid in Taxes

Solve

You are given a 0-indexed 2D integer array brackets where brackets[i] = [upperi, percenti] means that the ith tax bracket has an upper bound of upperi and is ta...

EasyVery Likely
arraysimulation

Maximum Profit in Job Scheduling

Solve

We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].

HardVery Likely
arraybinary-searchdynamic-programming

Trapping Rain Water

Solve

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

HardVery Likely
arraytwo-pointersdynamic-programming

Painting the Walls

Solve

You are given two 0-indexed integer arrays, cost and time, of size n representing the costs and the time taken to paint n different walls respectively. There ar...

HardVery Likely
arraydynamic-programming

Parallel Courses III

Solve

You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given a 2D integer array relations where relations[j] = [...

HardVery Likely
arraydynamic-programminggraph

Number of Ways to Form a Target String Given a Dictionary

Solve

You are given a list of strings of the same length words and a string target.

HardVery Likely
arraystringdynamic-programming

Minimum Array Length After Pair Removals

Solve

Given an integer array num sorted in non-decreasing order.

MediumVery Likely
arrayhash-tabletwo-pointers

Find the Maximum Length of a Good Subsequence I

Solve

You are given an integer array nums and a non-negative integer k. A sequence of integers seq is called good if there are at most k indices i in the range [0, se...

MediumVery Likely
arrayhash-tabledynamic-programming

Find the Maximum Length of a Good Subsequence II

Solve

You are given an integer array nums and a non-negative integer k. A sequence of integers seq is called good if there are at most k indices i in the range [0, se...

HardVery Likely
arrayhash-tabledynamic-programming

Basic Calculator

Solve

Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation.

HardLikely
mathstringstack

Regular Expression Matching

Solve

Given an input string s and a pattern p, implement regular expression matching with support for '.' and '' where:

HardLikely
stringdynamic-programmingrecursion

Throne Inheritance

Solve

A kingdom consists of a king, his children, his grandchildren, and so on. Every once in a while, someone in the family dies or a child is born.

MediumLikely
hash-tabletreedepth-first-search

Count Vowel Substrings of a String

Solve

A substring is a contiguous (non-empty) sequence of characters within a string.

EasyLikely
hash-tablestring

Two Sum

Solve

Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target.

EasyLikely
arrayhash-map

Reverse Nodes in k-Group

Solve

Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.

HardLikely
linked-listrecursion

Time Based Key-Value Store

Solve

Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain...

MediumLikely
hash-tablestringbinary-search

Populating Next Right Pointers in Each Node II

Solve

Given a binary tree

MediumLikely
linked-listtreedepth-first-search

Populating Next Right Pointers in Each Node

Solve

You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:

MediumLikely
linked-listtreedepth-first-search

Course Schedule

Solve

There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, b...

MediumLikely
depth-first-searchbreadth-first-searchgraph

Max Area of Island

Solve

You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume al...

MediumLikely
arraydepth-first-searchbreadth-first-search

Merge Two Sorted Lists

Solve

You are given the heads of two sorted linked lists list1 and list2.

EasyLikely
linked-listrecursion

Design HashMap

Solve

Design a HashMap without using any built-in hash table libraries.

EasyLikely
arrayhash-tablelinked-list

Task Scheduler

Solve

You are given an array of CPU tasks, each labeled with a letter from A to Z, and a number n. Each CPU interval can be idle or allow the completion of one task....

MediumLikely
arrayhash-tablegreedy

Copy List with Random Pointer

Solve

A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null.

MediumLikely
hash-tablelinked-list

Sliding Window Median

Solve

The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middl...

HardLikely
arrayhash-tablesliding-window

LRU Cache

Solve

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

MediumLikely
hash-tablelinked-listdesign

Integer to English Words

Solve

Convert a non-negative integer num to its English words representation.

HardLikely
mathstringrecursion

Swap Nodes in Pairs

Solve

Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only...

MediumLikely
linked-listrecursion

Merge k Sorted Lists

Solve

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.

HardLikely
linked-listdivide-and-conquerheap-priority-queue

Patching Array

Solve

Given a sorted integer array nums and an integer n, add/patch elements to the array such that any number in the range [1, n] inclusive can be formed by the sum...

HardLikely
arraygreedy

Min Stack

Solve

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

MediumLikely
stackdesign

Basic Calculator II

Solve

Given a string s which represents an expression, evaluate this expression and return its value.

MediumLikely
mathstringstack

Find Median from Data Stream

Solve

The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two midd...

HardSometimes
two-pointersdesignsorting

N-Queens II

Solve

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.

HardSometimes
backtracking

Insert Delete GetRandom O(1)

Solve

Implement the RandomizedSet class:

MediumSometimes
arrayhash-tablemath

Implement Trie (Prefix Tree)

Solve

A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various appl...

MediumSometimes
hash-tablestringdesign

Remove K Digits

Solve

Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num.

MediumSometimes
stringstackgreedy

Random Pick with Weight

Solve

You are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index.

MediumSometimes
arraymathbinary-search

Count Nodes Equal to Average of Subtree

Solve

Given the root of a binary tree, return the number of nodes where the value of the node is equal to the average of the values in its subtree.

MediumSometimes
treedepth-first-searchbinary-tree

Count Subarrays With Fixed Bounds

Solve

You are given an integer array nums and two integers minK and maxK.

HardSometimes
arrayqueuesliding-window

Maximize Distance to Closest Person

Solve

You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that the ith seat...

MediumSometimes
array

Container With Most Water

Solve

You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).

MediumSometimes
arraytwo-pointersgreedy

Merge Intervals

Solve

Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...

MediumSometimes
arraysorting

Longest Univalue Path

Solve

Given the root of a binary tree, return the length of the longest path, where each node in the path has the same value. This path may or may not pass through th...

MediumSometimes
treedepth-first-searchbinary-tree

Remove Sub-Folders from the Filesystem

Solve

Given a list of folders folder, return the folders after removing all sub-folders in those folders. You may return the answer in any order.

MediumSometimes
arraystringdepth-first-search

Cheapest Flights Within K Stops

Solve

There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight...

MediumSometimes
dynamic-programmingdepth-first-searchbreadth-first-search

Top K Frequent Elements

Solve

Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.

MediumSometimes
arrayhash-tabledivide-and-conquer

Remove Invalid Parentheses

Solve

Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid.

HardSometimes
stringbacktrackingbreadth-first-search

Construct Binary Tree from Preorder and Inorder Traversal

Solve

Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, c...

MediumSometimes
arrayhash-tabledivide-and-conquer

N-Queens

Solve

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.

HardSometimes
arraybacktracking

Range Sum Query 2D - Immutable

Solve

Given a 2D matrix matrix, handle multiple queries of the following type:

MediumSometimes
arraydesignmatrix

Simplify Path

Solve

You are given an absolute path for a Unix-style file system, which always begins with a slash '/'. Your task is to transform this absolute path into its simplif...

MediumSometimes
stringstack

Number of Islands

Solve

Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.

MediumSometimes
arraydepth-first-searchbreadth-first-search

Cherry Pickup

Solve

You are given an n x n grid representing a field of cherries, each cell is one of three possible integers.

HardSometimes
arraydynamic-programmingmatrix

Making A Large Island

Solve

You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1.

HardSometimes
arraydepth-first-searchbreadth-first-search

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasySometimes
arraydynamic-programming

Maximum Number of Events That Can Be Attended

Solve

You are given an array of events where events[i] = [startDayi, endDayi]. Every event i starts at startDayi and ends at endDayi.

MediumSometimes
arraygreedysorting

Most Profitable Path in a Tree

Solve

There is an undirected tree with n nodes labeled from 0 to n - 1, rooted at node 0. You are given a 2D integer array edges of length n - 1 where edges[i] = [ai,...

MediumSometimes
arraytreedepth-first-search

Maximum Number of Removable Characters

Solve

You are given two strings s and p where p is a subsequence of s. You are also given a distinct 0-indexed integer array removable containing a subset of indices...

MediumSometimes
arraytwo-pointersstring

Leaf-Similar Trees

Solve

Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence.

EasySometimes
treedepth-first-searchbinary-tree

Swapping Nodes in a Linked List

Solve

You are given the head of a linked list, and an integer k.

MediumSometimes
linked-listtwo-pointers

Word Break

Solve

Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.

MediumSometimes
arrayhash-tablestring

Evaluate Division

Solve

You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai /...

MediumSometimes
arraystringdepth-first-search

Non-overlapping Intervals

Solve

Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the int...

MediumSometimes
arraydynamic-programminggreedy

Single Element in a Sorted Array

Solve

You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once.

MediumSometimes
arraybinary-search

Longest Substring Without Repeating Characters

Solve

Given a string s, find the length of the longest substring without duplicate characters.

MediumSometimes
hash-tablestringsliding-window

Reverse Only Letters

Solve

Given a string s, reverse the string according to the following rules:

EasySometimes
two-pointersstring

Design Add and Search Words Data Structure

Solve

Design a data structure that supports adding new words and finding if a string matches any previously added string.

MediumSometimes
stringdepth-first-searchdesign

Path With Minimum Effort

Solve

You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the height of cell...

MediumSometimes
arraybinary-searchdepth-first-search

Roman to Integer

Solve

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

EasySometimes
hash-tablemathstring

Snapshot Array

Solve

Implement a SnapshotArray that supports the following interface:

MediumSometimes
arrayhash-tablebinary-search

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Snowflake interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Snowflake coding interview

Snowflake interviews focus heavily on array, string, hash-table problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Snowflake interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Snowflake ask in interviews?add

Snowflake has been reported to ask 78 distinct coding problems. The most common topics are array, string, hash-table. 10 are Easy difficulty, 45 are Medium, and 23 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Snowflake coding interviews?add

Based on 78 reported problems, Snowflake interviews are significantly harder than average - 29% Hard vs 18% across all companies. 58% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Snowflake coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, hash-table. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Snowflake interview?

Simulate a real Snowflake coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Snowflake interview with AIarrow_forward