Sharechat | SDE II | DSA | Rejected
Anonymous User
943

This was the first round, and taken by SDE-1, Interviewer had forefront told that 2 problems need to be solved with working code able to cover all the test cases:

  • 1st Problem: Inversion Count

    • Based on the requirements, I had proposed solving using previous greater element, with O(n) time complexity, tried with few sample test cases, seemed to be working fine, interviewer took ~15 mins to verify the solution and asked to test with various cases during this period (he said he has seen this approach for the first time), after this he gave go ahead to implement (at this point he also asked if I've solved this problem before), had to use any preferred online ide (local ide wasn't allowed).
    • After testing few cases post implementation, interviewer had found a test case which was failing the implementation, then merge sort approach strike in my mind, but interviewer said to disscuss 2nd problem and if time remains can implement for merge sort.
  • 2nd Problem: Single element in sorted array

    • Started with hashmap, and for loop, eventually proposed O(logn) solution using multiples of 2 jumps
    • Interviewer had asked to think about any other approach in O(logn) complexity, I wasn't able to figureout, so gave go ahead to implement, code was working, but was failing for few edge cases, but since we were running out of time, interviewer asked to paste the same code, at this point binary search approach also striked in my mind and had mentioned, interviewer said binary search was indeed what he was expecting.

Next day recieved generic rejection email.

I think sharechat expects to just rote and solve the problem, instead of considering approach etc.

Comments (1)