Question: Find the k-th missing element from the left-most position in an array (4, 7, 9, 14, 15) with k=3. The output should be 8. Missing numbers are: 5, 6, 8, 10, 11, 12, 13.
Initially, I solved this problem with an approach that took me a few minutes, but it was not optimal. Later, I was asked to optimize both space and time complexity. I solved the space complexity issue, achieving O(1) space. The interviewer then asked me to further optimize the time complexity. I explained my scenario for optimizing the time complexity, and he asked me to write the code again.
Overall, I presented multiple approaches and improved my solution to optimize both time and space complexity each time. Finally, I arrived at an optimal solution but couldn't write the code for the last optimal approach because time ran out while discussing all the approaches to make the solution optimal.
After that, he asked me some JavaScript questions, most of which I answered correctly.
I request all interviewers: First, please consider the candidate's efforts in trying to achieve an optimal solution. Alternatively, when presenting a problem, clearly state that an optimal solution is required within a specific time limit and allow the candidate some time to think and make progress.
Question: Find the kth missing element from the left in the array (4, 7, 9, 14, 15). If k=3, the output is 8. Missing elements are: 5, 6, 8, 10, 11, 12, 13.
The following metrics were computed from 1 interview experience for the ServiceNow Software Engineer role in New Delhi, Delhi.
ServiceNow's interview process for their Software Engineer roles in New Delhi, Delhi is extremely selective, failing the vast majority of engineers.
Candidates reported having very negative feelings for ServiceNow's Software Engineer interview process in New Delhi, Delhi.