eBay Interview Experience (Rejected - Round 1)
Summary
I interviewed for a Software Engineer position at eBay, completed a CodeSignal coding round with two questions, but was rejected after the first round because I did not provide optimal solutions.
Full Experience
Recently, I interviewed with eBay for a Software Engineer role. The first round was a coding round on CodeSignal consisting of two questions.
Question 1: Find the K Smallest Elements from Multiple Sorted Arrays
Similar LeetCode: https://leetcode.com/problems/merge-k-sorted-lists/
My initial solution was to insert all elements into a min-heap and pop the smallest element k times. The interviewer accepted the implementation but later pointed out that it wasn't optimal.
I then optimized it by maintaining one pointer/index for each sorted array. Both visible test cases passed.
Question 2: Search in a Rotated Sorted Array
LeetCode 33: https://leetcode.com/problems/search-in-rotated-sorted-array/
I initially proposed the two-step approach:
- Find the pivot.
- Perform binary search on the appropriate half.
The interviewer asked for the optimal single-pass binary search solution instead.
I implemented it, but I wasn't fully confident. The code passed the visible test cases, but I knew there were edge cases I hadn't verified.
The interviewer pointed out two improvements:
- Use
mid = start + (end - start) / 2instead of(start + end) / 2to avoid integer overflow. - Return immediately when the target is found instead of storing the index and returning it later.
Unfortunately, this single pass approach I could not complete.
Result
I was rejected after the first round. The recruiter mentioned that I wasn't able to arrive at the optimal solution for both questions.
Takeaway
If you're interviewing at eBay, expect the interviewer to look beyond passing the visible test cases. They evaluate often by manually dry-running your code. If an optimal solution exists, implement it - take care of all smaller details like integer overflow etc - I was rejected due to this.
Interview Questions (2)
Find the K Smallest Elements from Multiple Sorted Arrays
Given multiple sorted arrays, return the k smallest elements across all arrays. The candidate first inserted all elements into a min‑heap and popped the smallest element k times, then optimized by maintaining a pointer for each array to achieve a more efficient solution.
Search in a Rotated Sorted Array
Given a rotated sorted array, find the index of a target value. The candidate first described a two‑step method (find the pivot then binary search the appropriate half) and was asked to provide a single‑pass binary search solution.