Problem database last updated: June 20, 2025

SSnap logo

Snap Coding Interview Questions

83 problems · 6 Easy, 54 Medium, 23 Hard · Ranked #27 of 458

Difficulty breakdown

6 Easy

7% · avg 23%

54 Medium

65% · avg 59%

23 Hard

28% · avg 18%

Top topics

array
61.4%
string
31.3%
dynamic-programming
25.3%
hash-table
21.7%
depth-first-search
18.1%2x
breadth-first-search
16.9%2x

Interview profile

Based on 83 reported problems, Snap interviews are slightly harder than average - 28% Hard vs 18% across all companies. The majority (65%) 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, Snap puts unusual emphasis on eulerian-circuit (2.4% of problems, 17.4x the industry average), shortest-path (2.4% of problems, 4.8x the industry average), geometry (2.4% of problems, 4.5x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (61.4%), string (31.3%), dynamic-programming (25.3%), hash-table (21.7%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 83 problems

LRU Cache

Solve

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

MediumVery Likely
hash-tablelinked-listdesign

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

Word Ladder

Solve

A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:

HardVery Likely
hash-tablestringbreadth-first-search

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.

HardVery Likely
arraydepth-first-searchbreadth-first-search

Word Break II

Solve

Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possi...

HardVery Likely
arrayhash-tablestring

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

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.

MediumVery Likely
arraydepth-first-searchbreadth-first-search

Bus Routes

Solve

You are given an array routes representing bus routes where routes[i] is a bus route that the ith bus repeats forever.

HardVery Likely
arrayhash-tablebreadth-first-search

Valid Sudoku

Solve

Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:

MediumVery Likely
arrayhash-tablematrix

Min Stack

Solve

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

MediumVery Likely
stackdesign

Power of Two

Solve

Given an integer n, return true if it is a power of two. Otherwise, return false.

EasyVery Likely
mathbit-manipulationrecursion

Combination Sum II

Solve

Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to...

MediumVery Likely
arraybacktracking

Frog Jump

Solve

A frog is crossing a river. The river is divided into some number of units, and at each unit, there may or may not exist a stone. The frog can jump on a stone,...

HardVery Likely
arraydynamic-programming

Wildcard Matching

Solve

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '' where:

HardVery Likely
stringdynamic-programminggreedy

Sudoku Solver

Solve

Write a program to solve a Sudoku puzzle by filling the empty cells.

HardVery Likely
arrayhash-tablebacktracking

Burst Balloons

Solve

You are given n balloons, indexed from 0 to n - 1. Each balloon is painted with a number on it represented by an array nums. You are asked to burst all the ball...

HardVery Likely
arraydynamic-programming

Bricks Falling When Hit

Solve

You are given an m x n binary grid, where each 1 represents a brick and 0 represents an empty space. A brick is stable if:

HardVery Likely
arrayunion-findmatrix

Least Operators to Express Number

Solve

Given a single positive integer x, we will write an expression of the form x (op1) x (op2) x (op3) x ... where each operator op1, op2, etc. is either addition,...

HardVery Likely
mathdynamic-programmingmemoization

Combination Sum IV

Solve

Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.

MediumVery Likely
arraydynamic-programming

Largest Merge Of Two Strings

Solve

You are given two strings word1 and word2. You want to construct a string merge in the following way: while either word1 or word2 are non-empty, choose one of t...

MediumVery Likely
two-pointersstringgreedy

Combination Sum

Solve

Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...

MediumVery Likely
arraybacktracking

Unique Binary Search Trees

Solve

Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n.

MediumVery Likely
mathdynamic-programmingtree

String Compression

Solve

Given an array of characters chars, compress it using the following algorithm:

MediumVery Likely
two-pointersstring

Reverse Words in a String

Solve

Given an input string s, reverse the order of the words.

MediumVery Likely
two-pointersstring

Game of Life

Solve

According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway...

MediumVery Likely
arraymatrixsimulation

Reverse Linked List

Solve

Given the head of a singly linked list, reverse the list, and return the reversed list.

EasyVery Likely
linked-listrecursion

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.

MediumVery Likely
stringstackgreedy

Basic Calculator II

Solve

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

MediumVery Likely
mathstringstack

Shortest Path in a Grid with Obstacles Elimination

Solve

You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an empty cell...

HardLikely
arraybreadth-first-searchmatrix

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...

MediumLikely
dynamic-programmingdepth-first-searchbreadth-first-search

Word Search

Solve

Given an m x n grid of characters board and a string word, return true if word exists in the grid.

MediumLikely
arraystringbacktracking

Decode Ways

Solve

You have intercepted a secret message encoded as a string of numbers. The message is decoded via the following mapping:

MediumLikely
stringdynamic-programming

Valid Arrangement of Pairs

Solve

You are given a 0-indexed 2D integer array pairs where pairs[i] = [starti, endi]. An arrangement of pairs is valid if for every index i where 1 <= i < pairs.len...

HardLikely
arraydepth-first-searchgraph

Best Time to Buy and Sell Stock III

Solve

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

HardLikely
arraydynamic-programming

Design a Text Editor

Solve

Design a text editor with a cursor that can do the following:

HardLikely
linked-liststringstack

Score of Parentheses

Solve

Given a balanced parentheses string s, return the score of the string.

MediumLikely
stringstack

Minimum Time to Complete All Tasks

Solve

There is a computer that can run an unlimited number of tasks at the same time. You are given a 2D integer array tasks where tasks[i] = [starti, endi, durationi...

HardLikely
arraybinary-searchstack

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 /...

MediumLikely
arraystringdepth-first-search

Amount of Time for Binary Tree to Be Infected

Solve

You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from the node with value start.

MediumLikely
hash-tabletreedepth-first-search

Insert Delete GetRandom O(1)

Solve

Implement the RandomizedSet class:

MediumLikely
arrayhash-tablemath

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...

MediumLikely
arraysorting

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] = [...

HardLikely
arraydynamic-programminggraph

Reconstruct Itinerary

Solve

You are given a list of airline tickets where tickets[i] = [fromi, toi] represent the departure and the arrival airports of one flight. Reconstruct the itinerar...

HardLikely
arraystringdepth-first-search

Binary Tree Maximum Path Sum

Solve

A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequ...

HardLikely
dynamic-programmingtreedepth-first-search

Accounts Merge

Solve

Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are...

MediumLikely
arrayhash-tablestring

Shortest Bridge

Solve

You are given an n x n binary matrix grid where 1 represents land and 0 represents water.

MediumLikely
arraydepth-first-searchbreadth-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 Consecutive Ones III

Solve

Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's.

MediumLikely
arraybinary-searchsliding-window

Group Anagrams

Solve

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

MediumLikely
arrayhash-tablestring

Merge Two Sorted Lists

Solve

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

EasyLikely
linked-listrecursion

Minimum Remove to Make Valid Parentheses

Solve

Given a string s of '(' , ')' and lowercase English characters.

MediumLikely
stringstack

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.

MediumLikely
arrayhash-tabledivide-and-conquer

K Closest Points to Origin

Solve

Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0).

MediumLikely
arraymathdivide-and-conquer

Find Peak Element

Solve

A peak element is an element that is strictly greater than its neighbors.

MediumLikely
arraybinary-search

Product of Array Except Self

Solve

Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

MediumLikely
arrayprefix-sum

Edit Distance

Solve

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

MediumLikely
stringdynamic-programming

Median of Two Sorted Arrays

Solve

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

HardLikely
arraybinary-searchdivide-and-conquer

Jump Game III

Solve

Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + arr[i] or i...

MediumLikely
arraydepth-first-searchbreadth-first-search

Custom Sort String

Solve

You are given two strings order and s. All the characters of order are unique and were sorted in some custom order previously.

MediumSometimes
hash-tablestringsorting

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 Subarray

Solve

Given an integer array nums, find the subarray with the largest sum, and return its sum.

MediumSometimes
arraydivide-and-conquerdynamic-programming

Search a 2D Matrix

Solve

You are given an m x n integer matrix matrix with the following two properties:

MediumSometimes
arraybinary-searchmatrix

Search Suggestions System

Solve

You are given an array of strings products and a string searchWord.

MediumSometimes
arraystringbinary-search

Longest String Chain

Solve

You are given an array of words where each word consists of lowercase English letters.

MediumSometimes
arrayhash-tabletwo-pointers

Car Fleet

Solve

There are n cars at given miles away from the starting mile 0, traveling to reach the mile target.

MediumSometimes
arraystacksorting

Minimum Number of Refueling Stops

Solve

A car travels from a starting position to a destination which is target miles east of the starting position.

HardSometimes
arraydynamic-programminggreedy

Knight Dialer

Solve

The chess knight has a unique movement, it may move two squares vertically and one square horizontally, or two squares horizontally and one square vertically (w...

MediumSometimes
dynamic-programming

Search a 2D Matrix II

Solve

Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties:

MediumSometimes
arraybinary-searchdivide-and-conquer

Minimum Area Rectangle

Solve

You are given an array of points in the X-Y plane points where points[i] = [xi, yi].

MediumSometimes
arrayhash-tablemath

Design Browser History

Solve

You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward in the hist...

MediumSometimes
arraylinked-liststack

Longest Increasing Path in a Matrix

Solve

Given an m x n integers matrix, return the length of the longest increasing path in matrix.

HardSometimes
arraydynamic-programmingdepth-first-search

Complement of Base 10 Integer

Solve

The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.

EasySometimes
bit-manipulation

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

Minimum Cost For Tickets

Solve

You have planned some train traveling one year in advance. The days of the year in which you will travel are given as an integer array days. Each day is an inte...

MediumSometimes
arraydynamic-programming

Flip String to Monotone Increasing

Solve

A binary string is monotone increasing if it consists of some number of 0's (possibly none), followed by some number of 1's (also possibly none).

MediumSometimes
stringdynamic-programming

Exclusive Time of Functions

Solve

On a single-threaded CPU, we execute a program containing n functions. Each function has a unique ID between 0 and n-1.

MediumSometimes
arraystack

Maximum Frequency Stack

Solve

Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.

HardSometimes
hash-tablestackdesign

Minimize Result by Adding Parentheses to Expression

Solve

You are given a 0-indexed string expression of the form "<num1>+<num2>" where <num1> and <num2> represent positive integers.

MediumSometimes
stringenumeration

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

Movie Rating

Solve

Table: Movies

MediumSometimes
database

Verifying an Alien Dictionary

Solve

In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of...

EasySometimes
arrayhash-tablestring

Reorder Data in Log Files

Solve

You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier.

MediumSometimes
arraystringsorting

Subarray Sum Equals K

Solve

Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.

MediumSometimes
arrayhash-tableprefix-sum

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 Snap interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Snap coding interview

Snap interviews focus heavily on array, string, dynamic-programming 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. Snap 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 Snap ask in interviews?add

Snap has been reported to ask 83 distinct coding problems. The most common topics are array, string, dynamic-programming. 6 are Easy difficulty, 54 are Medium, and 23 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Snap coding interviews?add

Based on 83 reported problems, Snap interviews are slightly harder than average - 28% Hard vs 18% across all companies. 65% 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 Snap coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, dynamic-programming. 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 Snap interview?

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

Simulate a Snap interview with AIarrow_forward