InterviewLegend

Backtracking and DP

Alex Chen40 min readUpdated 266 real interview reports

Most eBay coding problems are LeetCode mediums. The hard ones that do appear tend to be backtracking or DP, and the same few have come up in several loops since 2020, including a staff loop that added a follow-up on top of the base problem.

The backtracking problems at eBay often ask you to list every valid answer, which can make the output itself exponential. Say how big the search can get before you code. Keep the recursion's state small, and add a cache keyed on that state when the same subproblem repeats.

eBay's India hiring drives add a DP problem of their own. In one round the interviewer left the constraints to the candidate, so the method you pick depends on the bounds you state. Ask for them, or state your own, before choosing between recursion and a table.

These problems can also land late in a round. One has arrived with about ten minutes left, which is enough for a brute force and little else, so practice each one until a working version comes out quickly. The three problems below are worked end to end.

eBayPremium lesson · Coding round

The 3 eBay problems are below.

  1. A Premium questionCoding · Hard · Frequently asked
  2. A Premium questionCoding · Hard · Frequently asked
  3. A Premium questionCoding · Hard

Each with hints, the follow-up and a tested solution.

Get the eBay questions

$49 a year · all 100 companies · cancel anytime

From 266 eBay reports, forum threads behind logins and write-ups in Chinese.

Had your eBay interview?Tell us what they asked. Reviewed before it goes in, never with your name.
eBay interview guide

Know what eBay asks before you walk in.

33 coding · 5 system design · 30 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.