Snap Coding Interview Questions
26 Snap coding interview problems with full optimal solutions — 16 easy, 8 medium, 2 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Snap interviewer values, and a FAQ section.
Showing 10 problems of 26
- #28easyfoundational
28. Find the Index of the First Occurrence in a String
Snap's chat search highlights the first match of a keyword in a message thread — this is the substring-search primitive behind that feature.
- #102easyfoundational
102. Binary Tree Level Order Traversal
Snap's story hierarchy — user stories nested inside friend-group stories nested inside curated collections — is a tree. Level-order traversal is how that hierarchy renders top-down in the UI.
- #1easyfrequently asked
1. Two Sum
Given an array of integers and a target, return the indices of the two numbers that add up to the target. Snap uses this warm-up to gauge if you instinctively reach for a hash-map cache versus brute-forcing the lookup.
- #2easyfrequently asked
2. Valid Parentheses
Given a string containing brackets, determine if every opening bracket is closed by the matching type in the correct order. Snap uses this to verify you reach for a stack on linear matching problems.
- #3easyfrequently asked
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list by splicing nodes together. Snap uses this to confirm you can manipulate pointers without copying values and without losing the head.
- #5easyfrequently asked
5. Best Time to Buy and Sell Stock
Find the maximum profit from a single buy/sell on a price-per-day array. Snap uses this to verify you can convert a naive nested loop into a single-pass min-tracking sweep.
- #7easyfrequently asked
7. Valid Anagram
Given two strings, decide whether one is an anagram of the other. Snap uses this to verify candidates avoid sort-based answers when a count-array is faster.
- #8easyfrequently asked
8. Reverse Linked List
Reverse a singly-linked list in place. Snap uses this to verify pointer-juggling fluency and ability to articulate both iterative and recursive solutions.
- #9easyfrequently asked
9. Linked List Cycle
Determine whether a linked list has a cycle. Snap uses this to test pointer fluency and to see if you reach for Floyd's tortoise-and-hare instead of a hash set.
- #10easyfrequently asked
10. Maximum Subarray
Find the contiguous subarray with the largest sum. Snap uses this to verify you know Kadane's algorithm and can recognize a 1D running-sum DP without prompting.