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