Note that there are some explanatory texts on larger screens.

plurals
  1. POTech Interview Question-Is my approach correct?
    primarykey
    data
    text
    <p>Recently I was interviewed by a Software Company. I didnt make it through the first round itself.</p> <p>Maybe I was too slow in forming ideas or solving problems and wasnt good enough for the company that i interviewed for. I would like to have a second opinion about my interview and I cant find anyone better than the stackoverflow community.</p> <p>So this interview was a basic one</p> <ol> <li>Introduction</li> <li>Why you have applied for this position?</li> <li>One Techincal Question(Details Below)</li> <li>Whats the Worst software you have used? Why? Improve</li> <li>Whats the Best Software you have used? why Improve?</li> </ol> <p>Original Technical Question(As asked by the interviewer)</p> <p>Given a Range of numbers M.....M+N-1 I contruct an array of size N and replace one of the element in that array with a number. How will you find what element is replaced?</p> <p>I asked him to repeat the question once more as I thought the input was not sufficient to solve the problem. He repeated the statement ditto</p> <p>Q. Then I asked him Is the array you got from the range of number in sorted order?<br> Interviewer: Its not necessary</p> <p>Q Do we know the array before we replace an Element?<br> Interviewer: No</p> <p>Then i started Writing some pseudo code(while doing loud thinking). I immediately realized that It wont work if the original array had duplicates. So I was stuk for a while thinking how the hell am gonna solve this.Then finally I asked questions that mattered</p> <p>Q How do you choose the elements from the Range to form the array?<br> Interviewer: I have a range of number M, M+1, M+2....M+N-1. A number is picked only once. And I form an array of size N.(Which essentially means no Duplicates and all elements in the range get picked)</p> <p>Q What about the number you replace it with? Does it lie in the same range?<br> Interviewer: Yes it does.</p> <p>Then everything became clear</p> <p><strong>This was what he meant:</strong><br> Q I have a range of numbers starting from M , like M,M+1,M+2,M+3...M+N . I form an array of Size N, such that each element gets picked only once and the original array does not have any duplicates. I replace one of the elements in the array with a number in the same range. Find out what I picked from the range to replace?</p> <p>This is equivalent to finding duplicates in array. Here after replacement there will be only one pair of duplicates We can easily find that out in O(N^2) time or O(nlogn) time. I gave him both the algorithms.</p> <p>In the end I couldnt resist asking him "How did I perform in that question? He said Well you took a lot of time in answering.</p> <p><em>Clearly he was not satisfied with my approach to this question.<br> <strong>What do you think I should have done differently while answering this question?</em></strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload