The eBay Software Engineer Intern (SWE Intern) loop is one of those "medium difficulty but very topic-concentrated" pipelines that a lot of candidates apply to. Compared with the FAANG top tier, eBay's question surface looks tame on paper, but the distribution of topics is extremely stable. Lock down the five core themes plus the Karat-style follow-up patterns and you can drive your conversion rate up significantly.
This article reorganizes the real-world eBay questions found across multiple debrief threads into five themes: prefix array, string state machine, tree and graph, data structure design, and system design entry. Each theme ships with a representative problem, a complete Python solution, and a recommended time budget. If you are getting ready for the eBay intern OA, a Karat live coding session, or the final loop, treat this as the "must-clear once before exam day" checklist.
eBay SWE Intern Hiring Pipeline at a Glance
| Stage | Platform | Length | Question Format |
|---|---|---|---|
| Online Assessment | HackerRank | 60-75 min | 2 coding + occasional 4-6 MCQ |
| Karat Live Coding | Karat / Zoom | 60 min | 1-2 algorithm questions + follow-up optimization |
| Tech Phone | Zoom + CoderPad | 45 min | 1 medium algorithm + light OOD/system chat |
| Virtual Onsite | 4 rounds × 60 min | 1 working day | algorithm / system design / code review / behavioral |
Notes: HackerRank OA usually arrives 7-10 days after application. Karat plus Tech Phone typically run back to back over 2-3 weeks. Onsite is mostly remote, so be ready to coordinate time zones early.
Theme 1: Prefix Sums and Window Counting
Real question: Distinct promotions over a range
Given an array
promo[]of length N where each entry is a daily promotion id, plus Q queries(l, r), return the count of distinct promotion ids in each range. N, Q <= 1e5.
Approach:
- Mo's algorithm offline at O((N+Q) sqrt N) is the textbook answer.
- eBay OA usually has data sizes <= 1e5, so a per-id position list with binary search works well.
from collections import defaultdict
from bisect import bisect_left, bisect_right
def distinct_in_ranges(promo, queries):
pos = defaultdict(list)
for i, p in enumerate(promo):
pos[p].append(i)
res = []
for l, r in queries:
cnt = 0
for p, idxs in pos.items():
lo = bisect_left(idxs, l)
hi = bisect_right(idxs, r)
if hi > lo:
cnt += 1
res.append(cnt)
return res
Time complexity: O(Q * K * log N), where K is the distinct id count. Very fast when K is small. Space complexity: O(N).
Follow-up: If N=1e6 with online updates, switch to a persistent segment tree (a "chairman tree"). Verbalizing the idea is enough during the interview.
Theme 2: String State Machines and Parsing
Real question: Listing title validator
Given a product title string, validate against:
- cannot start with a lowercase letter
- cannot contain three consecutive identical letters
- cannot include dangerous keywords like
<,>,script- length must be 5 to 80
Return whether it is valid plus the first violation reason in priority order.
Approach: a clean rule pipeline is the most readable solution.
def validate_title(title: str) -> tuple[bool, str]:
if not (5 <= len(title) <= 80):
return False, "length"
if title[0].islower():
return False, "leading_lower"
for i in range(2, len(title)):
if title[i] == title[i-1] == title[i-2]:
return False, "triple_repeat"
blacklist = ("<", ">", "script", "javascript")
low = title.lower()
for kw in blacklist:
if kw in low:
return False, f"blacklist:{kw}"
return True, "ok"
Time complexity: O(N), where N is the title length. Bonus points: extract the rules into an enum + dataclass-driven validator chain to show extensibility.
Theme 3: Trees and Graphs (Site Topology)
Real question: Largest sales path on a category tree
Categories form a tree where each node carries a
salesvalue (positive or negative). Find the maximum path sum from the root to any leaf.
Approach:
- DFS top-down, accumulate the path sum, track the maximum.
- Sales can be negative, and the path must reach a leaf, so do not greedily prune mid-path.
class Node:
def __init__(self, sales: int):
self.sales = sales
self.children = []
def max_leaf_path(root: Node) -> int:
best = float("-inf")
def dfs(node, acc):
nonlocal best
acc += node.sales
if not node.children:
best = max(best, acc)
return
for c in node.children:
dfs(c, acc)
dfs(root, 0)
return best
Time complexity: O(N). Follow-up: If the prompt becomes "any start to any end," it collapses into the LeetCode 124 variant where you merge the best single-side path at every node.
Theme 4: Data Structure Design
Real question: Search LRU with hotness decay
Build a search cache:
query(keyword, ts)returns hits for that keyword and updates the latest access timestamptop_k(ts, k)returns the hottest k keywords up to the current time, where hotness = visit count multiplied by the decay factor0.99 ** (ts - last_ts)
Approach:
- Maintain a dict mapping keyword -> (count, last_ts)
- For top_k, sort by
count * (0.99 ** (ts - last_ts))
class HotSearch:
def __init__(self, decay=0.99):
self.decay = decay
self.data = {}
def query(self, keyword, ts):
if keyword not in self.data:
self.data[keyword] = [0, ts]
c, last = self.data[keyword]
c = c * (self.decay ** (ts - last)) + 1
self.data[keyword] = [c, ts]
def top_k(self, ts, k):
scored = [
(kw, c * (self.decay ** (ts - last)))
for kw, (c, last) in self.data.items()
]
scored.sort(key=lambda x: -x[1])
return [kw for kw, _ in scored[:k]]
Time complexity: query O(1), top_k O(N log N). Follow-up: optimize top_k to O(N) using buckets plus a heap. Interviewers love asking this one.
Theme 5: System Design Entry
Real question: Design the eBay listing detail API
Verbally design GET /listing/{id} covering:
- caching strategy (CDN / Redis / DB)
- how to absorb high read concurrency, how writes invalidate
- where listing images, recommendation slots, and price history come from
Answer skeleton (P-A-S model: Path / API / Storage):
- Path: CDN -> API Gateway -> Listing Service -> Cache (Redis) -> MySQL
- API: returns
{listing, seller, price_history, related_listings}by fanning out to independent fetchers, then merging - Storage: listing main table on MySQL, images on S3 plus CDN, recommendations from an ML service, price history on ClickHouse time series
- Consistency: on writes, update DB first then refresh Redis asynchronously via CDC (Debezium); TTL is the safety net
- Hot keys: layer a local cache in front of Redis for hot listings to avoid thundering herd
Preparation Roadmap: A Four-Week Cadence
| Week | Primary Task |
|---|---|
| Week 1 | LeetCode "eBay" tag and Top 50 medium problems |
| Week 2 | Focus drills on theme 2 and 3 (strings, tree/graph) |
| Week 3 | Data structure design and the P-A-S system design template |
| Week 4 | Karat mocks plus polishing STAR stories for behavioral |
FAQ
Q1: How does the eBay SWE Intern OA difficulty compare with LeetCode? Roughly LeetCode medium with mild lean. A few batches drop one harder problem. The real test is delivering bug-free code in 60 minutes, not chasing the optimal solution.
Q2: What HackerRank platform pitfalls should I expect?
The default editor lacks LSP. Draft locally and paste. Input parsing usually relies on input().split(), so do not burn time on IO scaffolding.
Q3: Is Karat as strict as the official onsite? Karat is outsourced and tends to score objectively, with a pass rate around 50 percent. Difficulty is slightly above OA, but interviewers welcome more dialogue.
Q4: What does an eBay intern actually work on? Spread across Listings, Search, Trust and Safety, Payments, and similar teams. Frontend is React. Backend is Java plus Scala. Data is Spark.
Q5: How do I lift my eBay final loop pass rate?
- Research the target team product in advance.
- Prepare at least five STAR stories covering conflict, leadership, and failure.
- Use the P-A-S template for system design instead of stacking buzzwords.
Preparing for the eBay intern interview?
If your OA link has arrived but two questions in 60 minutes feels tight, or the Karat round keeps stalling on follow-ups, we can talk through end-to-end OA proxy / VO assist / VO proxy options - from interview-day live shadowing and topic mapping to STAR story polishing.
Contact
Need real interview questions and a custom prep plan? Add WeChat Coding0201 now to get questions.
Email: [email protected] Telegram: @OAVOProxy