Vercel Coding Interview Questions
100 Vercel coding interview problems with full optimal solutions — 30 easy, 64 medium, 6 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Vercel interviewer values, and a FAQ section.
- #1easyfrequently asked
1. Two Sum
Given an array of integers and a target, return the indices of two numbers that add up to the target. Vercel asks this as a warm-up to test whether you reach for a hash map instinctively when you see a 'find a pair' problem in their edge-routing or cache-key dedup contexts.
- #2easyfrequently asked
2. Valid Parentheses
Given a string of brackets, decide if it's balanced. Vercel uses this to test whether you recognize the stack pattern instantly — it's the same shape as their route-segment matching in nested layout trees.
- #3easyfrequently asked
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list by splicing nodes together. Vercel asks this as the building block of their log-merge sub-question for edge-function telemetry — same pattern as merging sorted per-region access logs.
- #4easysometimes asked
4. Remove Duplicates from Sorted Array
Remove duplicates from a sorted array in-place and return the new length. Vercel asks this to test whether you can shed allocations — relevant when their edge runtime has a tight memory budget per function invocation.
- #5easysometimes asked
5. Remove Element
Remove all occurrences of a value from an array in-place and return the new length. Vercel asks this because it's the in-place filter that shows up everywhere in their middleware request-rewriting code path.
- #6easysometimes asked
6. Search Insert Position
Given a sorted array and a target, return the index where the target is or where it should be inserted. Vercel asks this to confirm you can write a clean binary search with the 'lower-bound' semantic — exactly what their route-matching trie uses to find the matching prefix.
- #7easysometimes asked
7. Plus One
Given an array of digits representing a non-negative integer, add one and return the result as an array. Vercel uses this as a 'do you handle carries cleanly' screen — the same skill you need to bump build numbers or version tags in their deployment graph.
- #8easysometimes asked
8. Merge Sorted Array
Merge two sorted arrays into one in-place, with the first array sized to hold both. Vercel asks this for the back-to-front two-pointer trick — relevant whenever they merge per-region cache hit/miss telemetry arrays without allocating.
- #9easysometimes asked
9. Binary Tree Inorder Traversal
Walk a binary tree in-order and return the values. Vercel asks this as a recursion warmup before harder tree problems — and because the iterative version with an explicit stack mirrors how their build graph walks dependencies.
- #10easysometimes asked
10. Same Tree
Given two binary trees, decide if they are structurally identical with the same values at every position. Vercel uses this as a recursion warm-up before deeper tree questions about their route trees.
- #11easysometimes asked
11. Symmetric Tree
Given a binary tree, check if it is a mirror of itself (symmetric around its center). Vercel asks this because the recursive mirror-comparison shape shows up in their A/B route-mirror experiments.
- #12easyfrequently asked
12. Maximum Depth of Binary Tree
Given a binary tree, return its maximum depth. Vercel asks this to confirm you can do the 'max + 1' recursive pattern — the same trick they use to compute the longest deployment dependency chain.
- #13easysometimes asked
13. Balanced Binary Tree
Determine if a binary tree is height-balanced (left and right subtrees of every node differ in height by at most 1). Vercel asks this for the early-exit recursive pattern — a small twist on max-depth that catches sloppy candidates.
- #14easysometimes asked
14. Minimum Depth of Binary Tree
Find the shortest path from the root to any leaf. Vercel asks this because the recursion has a subtle gotcha that catches candidates who blindly mirror max-depth.
- #15easyrarely asked
15. Pascal's Triangle
Generate the first numRows of Pascal's triangle. Vercel asks this for the row-from-previous-row recurrence — same pattern they use to compute layer-by-layer rendering costs in their build dependency tree.
- #16easyfrequently asked
16. Best Time to Buy and Sell Stock
Given an array of stock prices, find the max profit from a single buy-then-sell. Vercel asks this because the 'track min so far' pattern is identical to how their edge analytics finds the cheapest-cost path over a time-series of latencies.
- #17easysometimes asked
17. Valid Palindrome
Decide whether a string is a palindrome after normalizing (lowercase + remove non-alphanumeric). Vercel asks this to test string-handling fluency plus the two-pointer in-place sweep — same pattern as their URL-segment normalizer.
- #18easysometimes asked
18. Single Number
Given an array where every element appears twice except one, find the single one in O(n) time and O(1) space. Vercel asks this for the XOR trick — useful in cache-line dedup and the kind of bit-level micro-optimizations that show up in their edge runtime.
- #19easyfrequently asked
19. Linked List Cycle
Given a linked list, determine whether it has a cycle. Vercel asks this because Floyd's tortoise-and-hare is the gateway to a class of pointer-pacing tricks they use in their request-pipeline scheduler.
- #20easysometimes asked
20. Min Stack
Design a stack that supports push, pop, top, and getMin in O(1). Vercel asks this because the auxiliary-stack pattern is the same shape they use to track the lowest-cost deployment plan at every point in a rolling release.
- #21easysometimes asked
21. Two Sum II - Input Array Is Sorted
Given a sorted array and a target, return the two indices whose values sum to the target. Vercel asks this to confirm you recognize 'sorted' as the cue for two-pointer over hash map — same instinct you need when their edge data is pre-sorted by request timestamp.
- #22easysometimes asked
22. Majority Element
Find the element that appears more than n/2 times. Vercel asks this for Boyer-Moore — the O(1) space trick that finds the consensus item in a stream, useful for their canary deploy 'majority of nodes report healthy' check.
- #23easysometimes asked
23. Rotate Array
Rotate an array to the right by k steps in-place. Vercel asks this for the reverse-thrice trick — clean O(1) space pattern that catches anyone who hasn't internalized it.
- #24easyrarely asked
24. Reverse Bits
Reverse the bits of a 32-bit unsigned integer. Vercel asks this to see if you can hold bit positions in your head — relevant when working with edge-routing flag masks or compact cache headers.
- #25easyrarely asked
25. Number of 1 Bits
Count the number of set bits in a 32-bit integer (Hamming weight). Vercel uses this as the gateway to bit tricks they reach for in compact feature-flag masks and quick set-difference operations.
- #26easysometimes asked
26. House Robber
Given an array of house values, find the max amount you can rob without robbing two adjacent houses. Vercel asks this as the introductory DP — the same recurrence shape as their 'pick-at-most-N-non-conflicting-deploys' scheduling logic.
- #27easyrarely asked
27. Happy Number
Determine whether a number is 'happy' (repeatedly replace with sum of squares of digits until it reaches 1, or loops forever). Vercel asks this for the cycle-detection variant of Floyd's algorithm — same shape as detecting redirect loops in their edge router.
- #28easyrarely asked
28. Isomorphic Strings
Determine if two strings are isomorphic (consistent one-to-one character mapping). Vercel asks this because the bidirectional-mapping check is the same shape as their canary deploy 'this version maps consistently to that traffic slice' validator.
- #29easyfrequently asked
29. Reverse Linked List
Reverse a singly linked list in-place. Vercel asks this constantly because it's the building block of every list-manipulation problem they care about — and because they want to see if you can do both iterative and recursive cleanly.
- #30easyfrequently asked
30. Contains Duplicate
Given an array, return true if any element appears more than once. Vercel asks this as the simplest set-based question; it's the warm-up before they pivot to streaming dedup or cache-key collisions.
- #31mediumfrequently asked
31. Add Two Numbers
Add two numbers represented as linked lists with digits in reverse order. Vercel asks this for the carry-propagation pattern across two cursors — the same shape they use when merging deltas from two edge nodes that drifted out of sync.
- #32mediumfrequently asked
32. Longest Substring Without Repeating Characters
Find the length of the longest substring without repeating characters. Vercel asks this as their canonical sliding-window question — the same shape they use to find the longest run of unique cache-keys before invalidation.
- #33mediumsometimes asked
33. Longest Palindromic Substring
Find the longest palindromic substring. Vercel asks this for the expand-around-center technique, which is the cleanest O(n^2) approach and shows up in their text-diff and serverless cold-start analysis.
- #34mediumfrequently asked
34. Container With Most Water
Given a set of vertical lines, find the two that hold the most water between them. Vercel asks this for the two-pointer optimization — and because the 'always move the shorter side' invariant is the same shape as their bandwidth-allocation greedy.
- #35mediumfrequently asked
35. 3Sum
Given an array, return all unique triplets that sum to zero. Vercel asks this for the sort + two-pointer pattern and the dedup logic — both classic interview tests of attention to detail.
- #36mediumsometimes asked
36. Letter Combinations of a Phone Number
Given a string of digits 2-9, return all possible letter combinations the number could represent on a phone keypad. Vercel asks this as a classic backtracking warm-up — same recursive shape as enumerating all valid route-segment combinations in their dynamic-segment matcher.
- #37mediumfrequently asked
37. Remove Nth Node From End of List
Remove the nth node from the end of a linked list in one pass. Vercel asks this for the two-pointer offset trick — same pattern as their 'replay last N events' streaming primitive.
- #38mediumfrequently asked
38. Generate Parentheses
Generate all combinations of n pairs of well-formed parentheses. Vercel asks this for the constrained-backtracking pattern — same shape as enumerating valid nested route configurations under their layout-tree rules.
- #39mediumsometimes asked
39. Swap Nodes in Pairs
Swap every two adjacent nodes in a linked list. Vercel asks this for the pointer-juggling discipline — same skill needed to reorganize chunks in their streaming-response pipeline.
- #40mediumsometimes asked
40. Next Permutation
Rearrange numbers into the lexicographically next greater permutation in-place. Vercel asks this for the find-pivot-then-swap-then-reverse algorithm — a classic that distinguishes candidates who have actually studied the canonical patterns.
- #41mediumfrequently asked
41. Search in Rotated Sorted Array
Search for a target in a rotated sorted array in O(log n). Vercel asks this for the binary-search-with-rotation reasoning — same shape as their consistent-hashing key lookup when the ring has been shifted.
- #42mediumsometimes asked
42. Find First and Last Position of Element in Sorted Array
Given a sorted array, find the first and last index of a target in O(log n). Vercel asks this for the two-binary-search pattern (lower-bound + upper-bound) — same shape as their time-range bucket lookup for analytics queries.
- #43mediumsometimes asked
43. Valid Sudoku
Determine if a 9x9 Sudoku board is valid. Vercel asks this for the three-constraint-set tracking — same skill they use to validate routing rules that must satisfy uniqueness across multiple dimensions.
- #44mediumsometimes asked
44. Combination Sum
Given candidates and a target, return all unique combinations that sum to target (numbers may repeat). Vercel asks this for the backtracking-with-start-index pattern — same shape as their unbounded resource-bundling search.
- #45mediumfrequently asked
45. Permutations
Generate all permutations of a distinct-integer array. Vercel asks this as the canonical backtracking question — same recursive shape as enumerating valid edge-routing orderings for their A/B traffic-split experiments.
- #46mediumsometimes asked
46. Rotate Image
Rotate an n x n matrix 90 degrees clockwise in-place. Vercel asks this for the transpose-then-reverse trick — and to see if you can reason about coordinate transformations cleanly.
- #47mediumfrequently asked
47. Group Anagrams
Group strings that are anagrams of each other. Vercel asks this for the canonical-key + hash-map pattern — same shape as dedup in their build cache where alphabetically reordered dependency arrays should hash to the same key.
- #48mediumsometimes asked
48. Spiral Matrix
Given a matrix, return all elements in spiral order. Vercel asks this to see if you can manage four mutually-shrinking bounds without off-by-one errors — a clean test of disciplined iteration.
- #49mediumfrequently asked
49. Jump Game
Given an array of max-jump lengths from each index, decide if you can reach the last index. Vercel asks this for the greedy 'max reachable so far' pattern — same shape as their step-by-step deploy-graph reachability checks.
- #50mediumfrequently asked
50. Merge Intervals
Merge overlapping intervals. Vercel asks this for the sort-then-sweep pattern — the same shape as their cache-invalidation merging (overlapping TTL windows collapse into a single invalidation pass).
- #51mediumsometimes asked
51. Unique Paths
Count the number of unique paths from top-left to bottom-right in an m x n grid, moving only right or down. Vercel asks this as the simplest 2D DP — same shape as counting valid deploy paths from source commit to target environment.
- #52mediumsometimes asked
52. Minimum Path Sum
Find the minimum sum path from top-left to bottom-right in a grid, moving only right or down. Vercel asks this for the weighted-grid DP variation — same recurrence as cheapest-route in their multi-region edge deployment cost matrix.
- #53mediumfrequently asked
53. Simplify Path
Given an absolute Unix file path, simplify it (canonical form). Vercel asks this directly — they literally need this logic in their edge router for canonicalizing URL paths and resolving `..` segments.
- #54mediumsometimes asked
54. Edit Distance
Find the minimum number of operations (insert, delete, replace) to transform word1 into word2. Vercel asks this for the canonical 2D DP — same recurrence shape as their config-diff and CRDT merge cost calculator.
- #55mediumsometimes asked
55. Set Matrix Zeroes
If an element in an m x n matrix is 0, set its entire row and column to 0. Vercel asks this for the in-place O(1) extra space trick — using the first row and column as marker storage.
- #56mediumsometimes asked
56. Search a 2D Matrix
Search a target in an m x n matrix where rows are sorted and each row's first element > previous row's last. Vercel asks this for the 'treat as 1D and binary search' insight — same shape as searching a flattened time-series of edge metrics.
- #57mediumsometimes asked
57. Sort Colors
Sort an array of 0s, 1s, and 2s in one pass without extra space (Dutch National Flag). Vercel asks this for the three-pointer partitioning — same shape as their priority-bucket scheduler for request fan-out.
- #58mediumsometimes asked
58. Subsets
Return all possible subsets of a distinct-integer array. Vercel asks this for the include-or-skip backtracking pattern — same shape as enumerating valid feature-flag combinations for their canary configuration system.
- #59mediumfrequently asked
59. Word Search
Given a 2D board of letters and a word, return whether the word exists by adjacent-cell traversal. Vercel asks this for the DFS-with-visited-marker pattern — same shape as their route-prefix matching across the layout tree.
- #60mediumsometimes asked
60. Remove Duplicates from Sorted Array II
Remove duplicates from a sorted array so each element appears at most twice, in-place. Vercel asks this as an extension of LC 26 — same two-pointer pattern with a more general invariant.
- #61mediumsometimes asked
61. Search in Rotated Sorted Array II
Search a target in a rotated sorted array WITH duplicates. Vercel asks this for the worst-case O(n) reasoning — when duplicates break the 'one half is sorted' invariant.
- #62mediumsometimes asked
62. Remove Duplicates from Sorted List II
Remove ALL nodes that have duplicates from a sorted linked list (keep only unique values). Vercel asks this for the two-cursor + skip-runs pattern with a dummy head — same shape as their event-stream dedup that drops any event seen more than once.
- #63mediumrarely asked
63. Partition List
Partition a linked list around a pivot value while preserving relative order. Vercel asks this for the two-list splice pattern — same shape as their stable bucket-sort for priority-queued edge requests.
- #64mediumsometimes asked
64. Decode Ways
Count the number of ways to decode a numeric string into letters (1=A, 2=B, ..., 26=Z). Vercel asks this for the 1D DP with conditional transitions — same shape as counting valid parses of compressed config strings.
- #65mediumsometimes asked
65. Reverse Linked List II
Reverse a sublist of a linked list between positions left and right in one pass. Vercel asks this for the in-place sublist surgery — same pointer-juggling discipline they need to reorder middleware stages.
- #66mediumrarely asked
66. Restore IP Addresses
Given a string of digits, return all valid IP addresses that can be formed. Vercel asks this for the bounded-backtracking pattern with multiple validation rules — exactly the shape of validating their edge node IP allowlists.
- #67mediumrarely asked
67. Unique Binary Search Trees
Count the number of structurally unique BSTs that store values 1..n. Vercel asks this as a clean introduction to Catalan numbers via DP — same recurrence shape as their build-order-counting for module dependency trees.
- #68mediumfrequently asked
68. Validate Binary Search Tree
Determine if a binary tree is a valid BST. Vercel asks this for the min/max bounds propagation pattern — same recursive shape they use to validate that nested route configurations satisfy ancestor constraints.
- #69mediumfrequently asked
69. Binary Tree Level Order Traversal
Return the level-order (BFS) traversal of a binary tree, grouped by level. Vercel asks this for the level-tracking BFS pattern — same shape as their dependency-graph layer expansion for parallel builds.
- #70mediumsometimes asked
70. Binary Tree Zigzag Level Order Traversal
Return the zigzag level-order traversal (alternate left-to-right and right-to-left) of a binary tree. Vercel asks this as a small twist on BFS — the same shape with a per-level direction flag.
- #71mediumsometimes asked
71. Construct Binary Tree from Preorder and Inorder Traversal
Build a binary tree from its preorder and inorder traversals. Vercel asks this for the recursive split-by-root pattern — same shape as reconstructing a route tree from serialized formats they ingest from third-party config systems.
- #72mediumsometimes asked
72. Path Sum II
Return all root-to-leaf paths where the sum equals target. Vercel asks this for the backtracking-with-running-sum pattern — same shape as their cost-bounded route discovery in the deployment graph.
- #73mediumsometimes asked
73. Best Time to Buy and Sell Stock II
Buy and sell as many times as you want; find the max profit. Vercel asks this for the elegant greedy 'sum every positive gain' insight — same intuition as their adaptive bandwidth optimizer that captures every favorable swing.
- #74mediumsometimes asked
74. Word Ladder
Find the shortest transformation sequence between two words, changing one letter at a time. Vercel asks this for BFS on an implicit graph — same shape as their config-rollout path-finding through compatible intermediate states.
- #75mediumfrequently asked
75. Longest Consecutive Sequence
Find the length of the longest consecutive elements sequence in an unsorted array, in O(n). Vercel asks this for the hash-set 'only start from the run boundary' insight — same trick they use to find longest contiguous deploy intervals.
- #76mediumsometimes asked
76. Clone Graph
Deep-copy a connected undirected graph. Vercel asks this for the hash-map-while-traversing pattern — same shape as their build-graph cloning when forking a deployment branch.
- #77mediumfrequently asked
77. Copy List with Random Pointer
Deep-copy a linked list where each node has both .next and a .random pointer. Vercel asks this for the interleaving trick that achieves O(1) extra space — the kind of pointer-arithmetic discipline they need in their runtime.
- #78mediumfrequently asked
78. Word Break
Given a string and a dictionary, return whether the string can be segmented into space-separated dictionary words. Vercel asks this for the 1D DP with backward dependency — same shape as their incremental URL-path segmentation logic.
- #79mediumfrequently asked
79. LRU Cache
Design a Least-Recently-Used cache with O(1) get and put. Vercel asks this constantly — they literally maintain LRU caches at every edge POP and want to see if you can implement one with a doubly-linked list and a hash map.
- #80mediumsometimes asked
80. Sort List
Sort a linked list in O(n log n) time and O(1) extra space. Vercel asks this for the merge-sort-on-linked-list pattern — same skill as efficiently merging per-region log streams without random access.
- #81mediumsometimes asked
81. Maximum Product Subarray
Find the contiguous subarray within an integer array that has the largest product. Vercel asks this for the track-both-min-and-max trick — negatives flip the role, similar to how compounding latencies can flip favorable into unfavorable in their performance metrics.
- #82mediumfrequently asked
82. Find Minimum in Rotated Sorted Array
Find the minimum in a rotated sorted array. Vercel asks this for the binary-search-on-rotation-point pattern — same shape as locating the pivot in their consistent-hashing ring after a node was repositioned.
- #83mediumsometimes asked
83. Find Peak Element
Find any peak in an array (element greater than its neighbors) in O(log n). Vercel asks this for the 'binary search on a non-sorted array' insight — same trick they use to find the highest-traffic edge node in a request-rate gradient.
- #84mediumrarely asked
84. Fraction to Recurring Decimal
Convert a fraction to a string, marking any recurring decimal with parentheses. Vercel asks this to see whether you can handle multiple edge cases (sign, overflow, recurrence detection) with a hash-map cycle detector.
- #85mediumrarely asked
85. Excel Sheet Column Number
Convert an Excel-style column title (A, B, ..., Z, AA, AB, ...) to its corresponding integer. Vercel asks this for the base-26 arithmetic — same shape as converting their build-ID alphanumeric prefixes to lookup indices.
- #86mediumsometimes asked
86. Largest Number
Arrange a list of integers to form the largest possible number. Vercel asks this for the custom-comparator insight — same shape as ordering build artifacts by 'which goes first to maximize the final byte-sorted manifest.'
- #87mediumrarely asked
87. Repeated DNA Sequences
Find all 10-letter substrings that appear more than once in a DNA string. Vercel asks this for the rolling-hash / sliding-window pattern — same shape as their request-fingerprint dedup over a sliding time window.
- #88mediumfrequently asked
88. Number of Islands
Count the number of islands in a 2D grid of '1' (land) and '0' (water). Vercel asks this for the canonical grid-DFS / connected-components pattern — same shape as counting disjoint edge-failure clusters in their network monitoring.
- #89mediumfrequently asked
89. Course Schedule
Given a list of course prerequisites, determine if you can finish all courses. Vercel asks this for cycle detection in a directed graph — literally the same algorithm they use to detect dependency cycles in their deployment graph (build A depends on B, B on C, C on A is a deploy-killer).
- #90mediumfrequently asked
90. Implement Trie (Prefix Tree)
Implement a Trie with insert, search, and startsWith. Vercel asks this because Tries are the natural data structure for their route-segment matching — each path segment becomes a node, and prefix-search is exactly what the router does on every request.
- #91mediumfrequently asked
91. Kth Largest Element in an Array
Find the k-th largest element in an unsorted array. Vercel asks this for the min-heap and quickselect approaches — same shape as picking the top-k by latency in their edge-performance monitor.
- #92mediumfrequently asked
92. Lowest Common Ancestor of a Binary Tree
Find the lowest common ancestor of two nodes in a binary tree. Vercel asks this because LCA is the natural primitive for their route-tree common-segment resolution — exactly how they find the shared prefix between two dynamic routes.
- #93mediumfrequently asked
93. Product of Array Except Self
For each index, return the product of all other elements, without using division and in O(n). Vercel asks this for the prefix-product + suffix-product technique — same shape as their join-cost calculator across multiple parallel deploy graphs.
- #94mediumrarely asked
94. Group Shifted Strings
Group strings that are shifts of each other (caesar-cipher equivalent). Vercel asks this for the canonical-key + hash-map pattern with a custom equivalence relation — same shape as grouping shifted versions of the same edge-route signature.
- #95hardsometimes asked
95. Median of Two Sorted Arrays
Find the median of two sorted arrays in O(log(min(m,n))). Vercel asks this for the binary-search partition technique — a hard problem that distinguishes top candidates and shows up in their per-region latency aggregation when merging metric streams.
- #96hardsometimes asked
96. Regular Expression Matching
Implement regex matching with '.' (any char) and '*' (zero or more). Vercel asks this for the 2D DP that handles backtracking cleanly — same shape as their route-pattern matcher with wildcards.
- #97hardfrequently asked
97. Merge k Sorted Lists
Merge k sorted linked lists into one. Vercel asks this constantly — they literally merge k sorted log streams from edge POPs in their analytics pipeline, and the heap-based merge is the production solution.
- #98hardsometimes asked
98. Reverse Nodes in k-Group
Reverse every k consecutive nodes in a linked list. Vercel asks this for the disciplined pointer surgery — same skill as chunking a stream into fixed-size batches for their edge-function fan-out.
- #99hardfrequently asked
99. Trapping Rain Water
Compute how much rain water can be trapped after raining on an elevation map. Vercel asks this for the two-pointer 'water = min(maxLeft, maxRight) - height' insight — same shape as their bandwidth utilization calculation across uneven edge capacities.
- #100hardfrequently asked
100. Minimum Window Substring
Find the smallest substring of s containing all characters of t. Vercel asks this for the sliding-window-with-counter-map pattern — same shape as their 'find the smallest contiguous region that covers all required edge nodes' optimizer.