Coding Question:
Given an array of numbers. If you remove one number at any index, the sum of values at even and odd positions should be equal. Return that index of the array. If multiple are present return the first index and if no index present return -1.
First I wrote brute force it passed only 11 of 15 test cases. Then wrote a optimal solution, all test cases passed.
Not sure if I passed OA or not but got a call from Hiring Manager and he asked same HR to schedule interviews but this is for a different role "Software Developer 3"
Round 1 (1 hour)
There are two interviewers (one is HM)
HM asked a backtracking coding question
Question: Input a string length of N and a lucky number K. Return all the number strings where a single digit sum equals to K.
Example:
Input: N=4, K= 9
Output: ["0009", "0018",...] -> This array should also contain number strings like "5742" (sum of digits -> "18" -> "9")
I bombed it.
Another Interviewer first asked 2-3 question on Resume. I was not able to give proper answers.
Half of the time got over and here itself I knew I lost the chance and then the same inteviewer asked two coding questions.
(i) LRU cache - Told the doubly linked list solution
(ii) Top Kth Element - Told Min Heap Solution
These two I answered well.
At last, HM asked one puzzle
We have two hour glasses (sand stop watches). One counts 7 minutes and other one is 4 minutes. You need to count 9 minutes.
Took 5 minutes and gave a correct solution.
After the interview I called the HR, he said I didn't get a positive feedback. Rejected.
May be because first half of the interview didn't go well. Its Ok.