Ebay Interview Question
Summary
I recently had an offline interview experience with Ebay. The 30-minute interview primarily focused on a single Data Structures & Algorithms problem, 'Reverse Pairs'.
Full Experience
Had an interesting offline interview experience recently.
The interview was scheduled for 30 minutes, and the focus was mainly on one DSA problem.
Interview Questions (1)
Reverse Pairs
Given an integer array nums, return the number of reverse pairs in the array.
A reverse pair is defined as a pair (i, j) such that:
• 0 <= i < j < nums.length
• nums[i] > 2 * nums[j]
Example:
Input:
nums = [1,3,2,3,1]
Output:
2
Explanation:
The reverse pairs are:
• (1,4) → nums[1] = 3, nums[4] = 1, 3 > 2 * 1
• (3,4) → nums[3] = 3, nums[4] = 1, 3 > 2 * 1
Preparation Tips
If you are appearing for an eBay interview, make sure you have a solid grip on DSA and problem-solving.