Problem database last updated: June 20, 2025

EeBay logo

eBay Coding Interview Questions

73 problems · 14 Easy, 46 Medium, 13 Hard · Ranked #34 of 458

Difficulty breakdown

14 Easy

19% · avg 23%

46 Medium

63% · avg 59%

13 Hard

18% · avg 18%

Top topics

array
57.5%
string
31.5%
hash-table
24.7%
dynamic-programming
19.2%
sorting
16.4%
depth-first-search
15.1%1.7x

Interview profile

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.

All 73 problems

Partition Equal Subset Sum

Solve

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...

MediumVery Likely
arraydynamic-programming

LRU Cache

Solve

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

MediumVery Likely
hash-tablelinked-listdesign

Subtree of Another Tree

Solve

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...

EasyVery Likely
treedepth-first-searchstring-matching

Remove One Element to Make the Array Strictly Increasing

Solve

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...

EasyVery Likely
array

Minimize Maximum Pair Sum in Array

Solve

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.

MediumVery Likely
arraytwo-pointersgreedy

Binary Gap

Solve

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'...

EasyVery Likely
bit-manipulation

Design Skiplist

Solve

Design a Skiplist without using any built-in libraries.

HardVery Likely
linked-listdesign

Alternating Digit Sum

Solve

You are given a positive integer n. Each digit of n has a sign according to the following rules:

EasyVery Likely
math

Number of Islands

Solve

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.

MediumVery Likely
arraydepth-first-searchbreadth-first-search

Word Ladder

Solve

A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:

HardVery Likely
hash-tablestringbreadth-first-search

Open the Lock

Solve

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...

MediumVery Likely
arrayhash-tablestring

Move Zeroes

Solve

Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.

EasyVery Likely
arraytwo-pointers

Group Anagrams

Solve

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

MediumVery Likely
arrayhash-tablestring

Spiral Matrix

Solve

Given an m x n matrix, return all elements of the matrix in spiral order.

MediumVery Likely
arraymatrixsimulation

Word Search II

Solve

Given an m x n board of characters and a list of strings words, return all words on the board.

HardLikely
arraystringbacktracking

Binary Tree Zigzag Level Order Traversal

Solve

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...

MediumLikely
treebreadth-first-searchbinary-tree

Reconstruct Itinerary

Solve

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...

HardLikely
arraystringdepth-first-search

Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

Solve

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...

MediumLikely
arrayqueuesliding-window

Valid Parentheses

Solve

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

EasyLikely
stringstack

Kth Largest Element in an Array

Solve

Given an integer array nums and an integer k, return the kth largest element in the array.

MediumLikely
arraydivide-and-conquersorting

Course Schedule II

Solve

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...

MediumLikely
depth-first-searchbreadth-first-searchgraph

Course Schedule

Solve

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...

MediumLikely
depth-first-searchbreadth-first-searchgraph

Set Matrix Zeroes

Solve

Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's.

MediumLikely
arrayhash-tablematrix

Longest ZigZag Path in a Binary Tree

Solve

You are given the root of a binary tree.

MediumLikely
dynamic-programmingtreedepth-first-search

Rotting Oranges

Solve

You are given an m x n grid where each cell can have one of three values:

MediumLikely
arraybreadth-first-searchmatrix

Two Sum

Solve

Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target.

EasyLikely
arrayhash-map

Longest Substring Without Repeating Characters

Solve

Given a string s, find the length of the longest substring without duplicate characters.

MediumLikely
hash-tablestringsliding-window

Pow(x, n)

Solve

Implement pow(x, n), which calculates x raised to the power n (i.e., xn).

MediumLikely
mathrecursion

Search in Rotated Sorted Array

Solve

There is an integer array nums sorted in ascending order (with distinct values).

MediumLikely
arraybinary-search

Design a Stack With Increment Operation

Solve

Design a stack that supports increment operations on its elements.

MediumLikely
arraystackdesign

Binary Search Tree to Greater Sum Tree

Solve

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...

MediumLikely
treedepth-first-searchbinary-search-tree

Best Time to Buy and Sell Stock II

Solve

You are given an integer array prices where prices[i] is the price of a given stock on the ith day.

MediumLikely
arraydynamic-programminggreedy

Decode String

Solve

Given an encoded string, return its decoded string.

MediumLikely
stringstackrecursion

Concatenated Words

Solve

Given an array of strings words (without duplicates), return all the concatenated words in the given list of words.

HardLikely
arraystringdynamic-programming

Generate Parentheses

Solve

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

MediumLikely
stringdynamic-programmingbacktracking

Two Sum II - Input Array Is Sorted

Solve

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....

MediumLikely
arraytwo-pointersbinary-search

Matchsticks to Square

Solve

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...

MediumLikely
arraydynamic-programmingbacktracking

Nearest Exit from Entrance in Maze

Solve

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...

MediumLikely
arraybreadth-first-searchmatrix

Maximum Tastiness of Candy Basket

Solve

You are given an array of positive integers price where price[i] denotes the price of the ith candy and a positive integer k.

MediumLikely
arraybinary-searchgreedy

Roman to Integer

Solve

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

EasyLikely
hash-tablemathstring

Rotate Array

Solve

Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.

MediumLikely
arraymathtwo-pointers

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasyLikely
arraydynamic-programming

Maximum Subarray

Solve

Given an integer array nums, find the subarray with the largest sum, and return its sum.

MediumLikely
arraydivide-and-conquerdynamic-programming

Longest Palindromic Substring

Solve

Given a string s, return the longest palindromic substring in s.

MediumLikely
two-pointersstringdynamic-programming

Find Peak Element

Solve

A peak element is an element that is strictly greater than its neighbors.

MediumLikely
arraybinary-search

Longest Common Prefix

Solve

Write a function to find the longest common prefix string amongst an array of strings.

EasyLikely
arraystringtrie

Shortest Palindrome

Solve

You are given a string s. You can convert s to a palindrome by adding characters in front of it.

HardLikely
stringrolling-hashstring-matching

Majority Element

Solve

Given an array nums of size n, return the majority element.

EasyLikely
arrayhash-tabledivide-and-conquer

Product of Array Except Self

Solve

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].

MediumLikely
arrayprefix-sum

Koko Eating Bananas

Solve

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.

MediumLikely
arraybinary-search

Integer to Roman

Solve

Seven different symbols represent Roman numerals with the following values:

MediumLikely
hash-tablemathstring

Median of Two Sorted Arrays

Solve

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

HardLikely
arraybinary-searchdivide-and-conquer

Permutations

Solve

Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.

MediumLikely
arraybacktracking

Sort Colors

Solve

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...

MediumLikely
arraytwo-pointerssorting

First Missing Positive

Solve

Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums.

HardLikely
arrayhash-table

Merge k Sorted Lists

Solve

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.

HardLikely
linked-listdivide-and-conquerheap-priority-queue

Longest Valid Parentheses

Solve

Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring.

HardLikely
stringdynamic-programmingstack

Validate Binary Search Tree

Solve

Given the root of a binary tree, determine if it is a valid binary search tree (BST).

MediumLikely
treedepth-first-searchbinary-search-tree

Find Pivot Index

Solve

Given an array of integers nums, calculate the pivot index of this array.

EasyLikely
arrayprefix-sum

Maximal Square

Solve

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.

MediumLikely
arraydynamic-programmingmatrix

Time Based Key-Value Store

Solve

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...

MediumLikely
hash-tablestringbinary-search

Minimum Path Sum

Solve

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.

MediumLikely
arraydynamic-programmingmatrix

Top K Frequent Elements

Solve

Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.

MediumLikely
arrayhash-tabledivide-and-conquer

Rank Teams by Votes

Solve

In a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competition.

MediumLikely
arrayhash-tablestring

Valid Palindrome II

Solve

Given a string s, return true if the s can be palindrome after deleting at most one character from it.

EasyLikely
two-pointersstringgreedy

Integer to English Words

Solve

Convert a non-negative integer num to its English words representation.

HardLikely
mathstringrecursion

Isomorphic Strings

Solve

Given two strings s and t, determine if they are isomorphic.

EasyLikely
hash-tablestring

Word Break

Solve

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.

MediumLikely
arrayhash-tablestring

Find Minimum in Rotated Sorted Array

Solve

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:

MediumLikely
arraybinary-search

Reorganize String

Solve

Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.

MediumLikely
hash-tablestringgreedy

Vertical Order Traversal of a Binary Tree

Solve

Given the root of a binary tree, calculate the vertical order traversal of the binary tree.

HardLikely
hash-tabletreedepth-first-search

Binary Tree Cameras

Solve

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...

HardLikely
dynamic-programmingtreedepth-first-search

Copy List with Random Pointer

Solve

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.

MediumLikely
hash-tablelinked-list

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%

Preparing for your eBay coding interview

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.

Frequently Asked Questions

What coding problems does eBay ask in interviews?add

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.

How hard are eBay coding interviews?add

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.

How should I prepare for a eBay coding interview?add

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.

Other companies to explore

Ready to ace your eBay interview?

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