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.
Showing 63 problems of 100
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.
- #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.