Summary
I recently interviewed for a Software Engineer 2 position at Wex Inc, which involved a detailed Data Structures and Algorithms round.
Full Experience
My interview process for the Software Engineer 2 role at Wex Inc began with a dedicated Data Structures and Algorithms round. I was presented with two distinct coding challenges that tested my problem-solving abilities.
Interview Questions (2)
Given an array nums[] and a value k. The task is to find the maximum elements that can be made equal with at most k updates/increments.
Examples:
Input : nums[] = { 2, 4, 9 }, k = 3
Output : 2
We are allowed to do at most three increments. We can make two elements 4 by increasing 2 by 2. Note that we can not make two elements 9 as converting 4 to 9 requires 5 increments.
Input : nums[] = { 5, 5, 3, 1 }, k = 5
Output : 3
Explanation: Here 1st and 2nd elements are equal. Then we can increase 3rd element 3 upto 5. Then k becomes (k-2) = 3. Now we can’t increase 1 to 5 because k value is 3 and we need 4 for the updation. Thus equal elements possible are 3. Here we can also increase 1 to 5. Then also we have 3 because we can’t update 3 to 5.
Input : nums[] = { 5, 5, 3, 1 }, k = 6
Output : 4