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 eBay interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Problem database last updated: June 20, 2025
73 problems · 14 Easy, 46 Medium, 13 Hard · Ranked #34 of 458
14 Easy
19% · avg 23%
46 Medium
63% · avg 59%
13 Hard
18% · avg 18%
Based on 73 reported problems, eBay interviews are in line with industry averages - 18% Hard vs 18% overall. The majority (63%) 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, eBay puts unusual emphasis on hash-function (2.7% of problems, 4.7x the industry average), string-matching (2.7% of problems, 3.1x the industry average), quickselect (2.7% of problems, 2.6x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (57.5%), string (31.5%), hash-table (24.7%), dynamic-programming (19.2%). Problems below are sorted by frequency, the ones at the top are asked most often.
| Problem | Difficulty | Frequency | Topics | |
|---|---|---|---|---|
Partition Equal Subset Sum Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false oth... | Medium | Very Likely | arraydynamic-programming | Solve |
LRU Cache Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. | Medium | Very Likely | hash-tablelinked-listdesign | Solve |
Subtree of Another Tree Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false oth... | Easy | Very Likely | treedepth-first-searchstring-matching | Solve |
Remove One Element to Make the Array Strictly Increasing Given a 0-indexed integer array nums, return true if it can be made strictly increasing after removing exactly one element, or false otherwise. If the array is... | Easy | Very Likely | array | Solve |
Minimize Maximum Pair Sum in Array The pair sum of a pair (a,b) is equal to a + b. The maximum pair sum is the largest pair sum in a list of pairs. | Medium | Very Likely | arraytwo-pointersgreedy | Solve |
Binary Gap Given a positive integer n, find and return the longest distance between any two adjacent 1's in the binary representation of n. If there are no two adjacent 1'... | Easy | Very Likely | bit-manipulation | Solve |
Design Skiplist Design a Skiplist without using any built-in libraries. | Hard | Very Likely | linked-listdesign | Solve |
Alternating Digit Sum You are given a positive integer n. Each digit of n has a sign according to the following rules: | Easy | Very Likely | math | Solve |
Number of Islands 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. | Medium | Very Likely | arraydepth-first-searchbreadth-first-search | Solve |
Word Ladder A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that: | Hard | Very Likely | hash-tablestringbreadth-first-search | Solve |
Open the Lock You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely... | Medium | Very Likely | arrayhash-tablestring | Solve |
Move Zeroes Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. | Easy | Very Likely | arraytwo-pointers | Solve |
Group Anagrams Given an array of strings strs, group the anagrams together. You can return the answer in any order. | Medium | Very Likely | arrayhash-tablestring | Solve |
Spiral Matrix Given an m x n matrix, return all elements of the matrix in spiral order. | Medium | Very Likely | arraymatrixsimulation | Solve |
Word Search II Given an m x n board of characters and a list of strings words, return all words on the board. | Hard | Likely | arraystringbacktracking | Solve |
Binary Tree Zigzag Level Order Traversal Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level... | Medium | Likely | treebreadth-first-searchbinary-tree | Solve |
Reconstruct Itinerary 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... | Hard | Likely | arraystringdepth-first-search | Solve |
Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any two elemen... | Medium | Likely | arrayqueuesliding-window | Solve |
Valid Parentheses Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. | Easy | Likely | stringstack | Solve |
Kth Largest Element in an Array Given an integer array nums and an integer k, return the kth largest element in the array. | Medium | Likely | arraydivide-and-conquersorting | Solve |
Course Schedule II 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... | Medium | Likely | depth-first-searchbreadth-first-searchgraph | Solve |
Course Schedule 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... | Medium | Likely | depth-first-searchbreadth-first-searchgraph | Solve |
Set Matrix Zeroes Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's. | Medium | Likely | arrayhash-tablematrix | Solve |
Longest ZigZag Path in a Binary Tree You are given the root of a binary tree. | Medium | Likely | dynamic-programmingtreedepth-first-search | Solve |
Rotting Oranges You are given an m x n grid where each cell can have one of three values: | Medium | Likely | arraybreadth-first-searchmatrix | Solve |
Two Sum Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target. | Easy | Likely | arrayhash-map | Solve |
Longest Substring Without Repeating Characters Given a string s, find the length of the longest substring without duplicate characters. | Medium | Likely | hash-tablestringsliding-window | Solve |
Pow(x, n) Implement pow(x, n), which calculates x raised to the power n (i.e., xn). | Medium | Likely | mathrecursion | Solve |
Search in Rotated Sorted Array There is an integer array nums sorted in ascending order (with distinct values). | Medium | Likely | arraybinary-search | Solve |
Design a Stack With Increment Operation Design a stack that supports increment operations on its elements. | Medium | Likely | arraystackdesign | Solve |
Binary Search Tree to Greater Sum Tree Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum o... | Medium | Likely | treedepth-first-searchbinary-search-tree | Solve |
Best Time to Buy and Sell Stock II You are given an integer array prices where prices[i] is the price of a given stock on the ith day. | Medium | Likely | arraydynamic-programminggreedy | Solve |
Decode String Given an encoded string, return its decoded string. | Medium | Likely | stringstackrecursion | Solve |
Concatenated Words Given an array of strings words (without duplicates), return all the concatenated words in the given list of words. | Hard | Likely | arraystringdynamic-programming | Solve |
Generate Parentheses Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. | Medium | Likely | stringdynamic-programmingbacktracking | Solve |
Two Sum II - Input Array Is Sorted Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number.... | Medium | Likely | arraytwo-pointersbinary-search | Solve |
Matchsticks to Square You are given an integer array matchsticks where matchsticks[i] is the length of the ith matchstick. You want to use all the matchsticks to make one square. You... | Medium | Likely | arraydynamic-programmingbacktracking | Solve |
Nearest Exit from Entrance in Maze You are given an m x n matrix maze (0-indexed) with empty cells (represented as '.') and walls (represented as '+'). You are also given the entrance of the maze... | Medium | Likely | arraybreadth-first-searchmatrix | Solve |
Maximum Tastiness of Candy Basket You are given an array of positive integers price where price[i] denotes the price of the ith candy and a positive integer k. | Medium | Likely | arraybinary-searchgreedy | Solve |
Roman to Integer Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. | Easy | Likely | hash-tablemathstring | Solve |
Rotate Array Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. | Medium | Likely | arraymathtwo-pointers | Solve |
Best Time to Buy and Sell Stock You are given an array prices where prices[i] is the price of a given stock on the ith day. | Easy | Likely | arraydynamic-programming | Solve |
Maximum Subarray Given an integer array nums, find the subarray with the largest sum, and return its sum. | Medium | Likely | arraydivide-and-conquerdynamic-programming | Solve |
Longest Palindromic Substring Given a string s, return the longest palindromic substring in s. | Medium | Likely | two-pointersstringdynamic-programming | Solve |
Find Peak Element A peak element is an element that is strictly greater than its neighbors. | Medium | Likely | arraybinary-search | Solve |
Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. | Easy | Likely | arraystringtrie | Solve |
Shortest Palindrome You are given a string s. You can convert s to a palindrome by adding characters in front of it. | Hard | Likely | stringrolling-hashstring-matching | Solve |
Majority Element Given an array nums of size n, return the majority element. | Easy | Likely | arrayhash-tabledivide-and-conquer | Solve |
Product of Array Except Self 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]. | Medium | Likely | arrayprefix-sum | Solve |
Koko Eating Bananas Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours. | Medium | Likely | arraybinary-search | Solve |
Integer to Roman Seven different symbols represent Roman numerals with the following values: | Medium | Likely | hash-tablemathstring | Solve |
Median of Two Sorted Arrays Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. | Hard | Likely | arraybinary-searchdivide-and-conquer | Solve |
Permutations Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. | Medium | Likely | arraybacktracking | Solve |
Sort Colors Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order... | Medium | Likely | arraytwo-pointerssorting | Solve |
First Missing Positive Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums. | Hard | Likely | arrayhash-table | Solve |
Merge k Sorted Lists You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. | Hard | Likely | linked-listdivide-and-conquerheap-priority-queue | Solve |
Longest Valid Parentheses Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring. | Hard | Likely | stringdynamic-programmingstack | Solve |
Validate Binary Search Tree Given the root of a binary tree, determine if it is a valid binary search tree (BST). | Medium | Likely | treedepth-first-searchbinary-search-tree | Solve |
Find Pivot Index Given an array of integers nums, calculate the pivot index of this array. | Easy | Likely | arrayprefix-sum | Solve |
Maximal Square Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. | Medium | Likely | arraydynamic-programmingmatrix | Solve |
Time Based Key-Value Store Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain... | Medium | Likely | hash-tablestringbinary-search | Solve |
Minimum Path Sum Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. | Medium | Likely | arraydynamic-programmingmatrix | Solve |
Top K Frequent Elements Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order. | Medium | Likely | arrayhash-tabledivide-and-conquer | Solve |
Rank Teams by Votes In a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competition. | Medium | Likely | arrayhash-tablestring | Solve |
Valid Palindrome II Given a string s, return true if the s can be palindrome after deleting at most one character from it. | Easy | Likely | two-pointersstringgreedy | Solve |
Integer to English Words Convert a non-negative integer num to its English words representation. | Hard | Likely | mathstringrecursion | Solve |
Isomorphic Strings Given two strings s and t, determine if they are isomorphic. | Easy | Likely | hash-tablestring | Solve |
Word Break Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. | Medium | Likely | arrayhash-tablestring | Solve |
Find Minimum in Rotated Sorted Array Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: | Medium | Likely | arraybinary-search | Solve |
Reorganize String Given a string s, rearrange the characters of s so that any two adjacent characters are not the same. | Medium | Likely | hash-tablestringgreedy | Solve |
Vertical Order Traversal of a Binary Tree Given the root of a binary tree, calculate the vertical order traversal of the binary tree. | Hard | Likely | hash-tabletreedepth-first-search | Solve |
Binary Tree Cameras You are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate chil... | Hard | Likely | dynamic-programmingtreedepth-first-search | Solve |
Copy List with Random Pointer A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null. | Medium | Likely | hash-tablelinked-list | Solve |
Partition Equal Subset Sum
SolveGiven an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false oth...
LRU Cache
SolveDesign a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Subtree of Another Tree
SolveGiven the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false oth...
Remove One Element to Make the Array Strictly Increasing
SolveGiven a 0-indexed integer array nums, return true if it can be made strictly increasing after removing exactly one element, or false otherwise. If the array is...
Minimize Maximum Pair Sum in Array
SolveThe pair sum of a pair (a,b) is equal to a + b. The maximum pair sum is the largest pair sum in a list of pairs.
Binary Gap
SolveGiven a positive integer n, find and return the longest distance between any two adjacent 1's in the binary representation of n. If there are no two adjacent 1'...
Design Skiplist
SolveDesign a Skiplist without using any built-in libraries.
Alternating Digit Sum
SolveYou are given a positive integer n. Each digit of n has a sign according to the following rules:
Number of Islands
SolveGiven 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.
Word Ladder
SolveA transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:
Open the Lock
SolveYou have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely...
Move Zeroes
SolveGiven an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.
Group Anagrams
SolveGiven an array of strings strs, group the anagrams together. You can return the answer in any order.
Spiral Matrix
SolveGiven an m x n matrix, return all elements of the matrix in spiral order.
Word Search II
SolveGiven an m x n board of characters and a list of strings words, return all words on the board.
Binary Tree Zigzag Level Order Traversal
SolveGiven the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level...
Reconstruct Itinerary
SolveYou 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...
Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
SolveGiven an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any two elemen...
Valid Parentheses
SolveGiven a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
Kth Largest Element in an Array
SolveGiven an integer array nums and an integer k, return the kth largest element in the array.
Course Schedule II
SolveThere 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...
Course Schedule
SolveThere 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...
Set Matrix Zeroes
SolveGiven an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's.
Longest ZigZag Path in a Binary Tree
SolveYou are given the root of a binary tree.
Rotting Oranges
SolveYou are given an m x n grid where each cell can have one of three values:
Two Sum
SolveGiven an array of integers nums and an integer target, return the indices of the two numbers that add up to target.
Longest Substring Without Repeating Characters
SolveGiven a string s, find the length of the longest substring without duplicate characters.
Pow(x, n)
SolveImplement pow(x, n), which calculates x raised to the power n (i.e., xn).
Search in Rotated Sorted Array
SolveThere is an integer array nums sorted in ascending order (with distinct values).
Design a Stack With Increment Operation
SolveDesign a stack that supports increment operations on its elements.
Binary Search Tree to Greater Sum Tree
SolveGiven the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum o...
Best Time to Buy and Sell Stock II
SolveYou are given an integer array prices where prices[i] is the price of a given stock on the ith day.
Decode String
SolveGiven an encoded string, return its decoded string.
Concatenated Words
SolveGiven an array of strings words (without duplicates), return all the concatenated words in the given list of words.
Generate Parentheses
SolveGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Two Sum II - Input Array Is Sorted
SolveGiven a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number....
Matchsticks to Square
SolveYou are given an integer array matchsticks where matchsticks[i] is the length of the ith matchstick. You want to use all the matchsticks to make one square. You...
Nearest Exit from Entrance in Maze
SolveYou are given an m x n matrix maze (0-indexed) with empty cells (represented as '.') and walls (represented as '+'). You are also given the entrance of the maze...
Maximum Tastiness of Candy Basket
SolveYou are given an array of positive integers price where price[i] denotes the price of the ith candy and a positive integer k.
Roman to Integer
SolveRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Rotate Array
SolveGiven an integer array nums, rotate the array to the right by k steps, where k is non-negative.
Best Time to Buy and Sell Stock
SolveYou are given an array prices where prices[i] is the price of a given stock on the ith day.
Maximum Subarray
SolveGiven an integer array nums, find the subarray with the largest sum, and return its sum.
Longest Palindromic Substring
SolveGiven a string s, return the longest palindromic substring in s.
Find Peak Element
SolveA peak element is an element that is strictly greater than its neighbors.
Longest Common Prefix
SolveWrite a function to find the longest common prefix string amongst an array of strings.
Shortest Palindrome
SolveYou are given a string s. You can convert s to a palindrome by adding characters in front of it.
Majority Element
SolveGiven an array nums of size n, return the majority element.
Product of Array Except Self
SolveGiven 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].
Koko Eating Bananas
SolveKoko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.
Integer to Roman
SolveSeven different symbols represent Roman numerals with the following values:
Median of Two Sorted Arrays
SolveGiven two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
Permutations
SolveGiven an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.
Sort Colors
SolveGiven an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order...
First Missing Positive
SolveGiven an unsorted integer array nums. Return the smallest positive integer that is not present in nums.
Merge k Sorted Lists
SolveYou are given an array of k linked-lists lists, each linked-list is sorted in ascending order.
Longest Valid Parentheses
SolveGiven a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring.
Validate Binary Search Tree
SolveGiven the root of a binary tree, determine if it is a valid binary search tree (BST).
Find Pivot Index
SolveGiven an array of integers nums, calculate the pivot index of this array.
Maximal Square
SolveGiven an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.
Time Based Key-Value Store
SolveDesign a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain...
Minimum Path Sum
SolveGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.
Top K Frequent Elements
SolveGiven an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.
Rank Teams by Votes
SolveIn a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competition.
Valid Palindrome II
SolveGiven a string s, return true if the s can be palindrome after deleting at most one character from it.
Integer to English Words
SolveConvert a non-negative integer num to its English words representation.
Isomorphic Strings
SolveGiven two strings s and t, determine if they are isomorphic.
Word Break
SolveGiven a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.
Find Minimum in Rotated Sorted Array
SolveSuppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become:
Reorganize String
SolveGiven a string s, rearrange the characters of s so that any two adjacent characters are not the same.
Vertical Order Traversal of a Binary Tree
SolveGiven the root of a binary tree, calculate the vertical order traversal of the binary tree.
Binary Tree Cameras
SolveYou are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate chil...
Copy List with Random Pointer
SolveA linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null.
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent eBay interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
eBay interviews focus heavily on array, string, hash-table 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. eBay 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.
eBay has been reported to ask 73 distinct coding problems. The most common topics are array, string, hash-table. 14 are Easy difficulty, 46 are Medium, and 13 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
Based on 73 reported problems, eBay interviews are in line with industry averages - 18% Hard vs 18% overall. 63% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, hash-table. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real eBay coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.
Simulate a eBay interview with AIarrow_forward