Earlier quoted context omitted.
Same with some driving exam questions I have had. For example worded something like that, "does driving faster in some sections of the journey affect your planned time of arrival?" I don't remember if the wording was specifically like this, but it was something that to me logically obvious answer is "yes", but the correct answer and what they expect is "no", to show that you are a reasonable driver who won't speed un…
Wow those sound like such badly designed questions. What country is this?
I had to give a wrong answer to get the job (2017)
121–130 of 409 posts
Re: I had to give a wrong answer to get the job (2017)
#122One thing this reminds me of is the use of "Compute the nth Fibonacci number" as an interview question. The interviewer may expect you to show off your knowledge of dynamic programming by memoizing the function. But you take a risk if you implement the matrix exponentiation algorithm [1], which is actually optimal in that it only uses O(log(n)) arithmetic operations. I had an interviewer once who seemed a bit skeptic…
Is it really sublinear though? The data that the algorithm accepts is a number n, the size of the data is thus m=log(n), so the algorithm runs in O(m) time -> linear in terms of data size. I vaguely recall there was some nuisance related to this (pseudopolynomial algorithms ring a bell), but haven't interviewed in a while so may be misremembering it.
Re: I had to give a wrong answer to get the job (2017)
#123One thing this reminds me of is the use of "Compute the nth Fibonacci number" as an interview question. The interviewer may expect you to show off your knowledge of dynamic programming by memoizing the function. But you take a risk if you implement the matrix exponentiation algorithm [1], which is actually optimal in that it only uses O(log(n)) arithmetic operations. I had an interviewer once who seemed a bit skeptic…
Technically, you can calculate the nth Fibonacci number in O(1) with the golden number.
Re: I had to give a wrong answer to get the job (2017)
#124Now I wonder if it was designed to prevent this specific scenario.
Re: I had to give a wrong answer to get the job (2017)
#125Can't really comment on whether that was the correct way to handle the situation, given that passing the interview was the goal. However, I would have a hard time giving an incorrect answer on purpose. I also consider an interview as an opportunity to learn about the company I'm going to work for, and especially my future colleagues. I would probably try to give a full answer, such as "there's a widely-held concept X…
The goal of the interview shouldn't always be to get the job. If you have any length of career, you are interviewing the company as much (or more) than they are interviewing you. My approach would have been to go with the new idea and see what discussion can come out of it. If they don't have time to get into it, that's one thing but if they are simply not open-minded to new ideas, I don't want to work there.
Re: I had to give a wrong answer to get the job (2017)
#126Earlier quoted context omitted.
I disagree with this. If you believe that one thing "3 tier" means is that the client doesn't interact directly with a database, as the old fat-client -> database model did, then "MVC" was one pattern to accomplish that. So, to me, there is some relationship. Enough of one to have a interview discussion about it. I do agree that they aren't the same thing, but they are pretty clearly related to me. The interview ques…
The model's state is not the same thing as the model and even though it's 99% the case, the model in MVC should not be an anemic model.
Re: I had to give a wrong answer to get the job (2017)
#127I don't remember the exact problem they wanted me to solve, but the answer involved a dynamic collection and they wanted it to grow with constant time complexity. They were probably looking for a linked list. But I said I'd use a dynamic array because those have constant time when averaged over a series of appends.
I don't know if I remembered the term "amortized complexity" or not, but it was clear that they had never heard of doing amortized analysis across a series of operations and they absolutely did not get my answer. They got hung up on the idea that some appends force the array to grow and get copied. I tried to explain that that was only true for a predictable fraction of them, but they were stuck on the idea that this meant dynamic arrays had O(n) worst case performance. They clearly thought I didn't know what the hell I was talking about.
I'm pretty sure that was the point where they decided to pass on me.
But now I'm a senior software engineer at Google and I just finished writing a textbook that explains dynamic arrays including their amortized analysis, so joke's on them.
Re: I had to give a wrong answer to get the job (2017)
#128Earlier quoted context omitted.
Wow those sound like such badly designed questions. What country is this?
I don't know about that person, but a friend of mine from India was telling me about a driving test question there - [translated] "How far should you stay behind another car - A) 2 meters B) 2 seconds". Apparently the correct answer is 2 seconds. In my opinion, the question is weirdly ambiguous.
Re: I had to give a wrong answer to get the job (2017)
#129I bombed an interview at a game company because I gave a right answer that I couldn't get them to understand. I don't remember the exact problem they wanted me to solve, but the answer involved a dynamic collection and they wanted it to grow with constant time complexity. They were probably looking for a linked list. But I said I'd use a dynamic array because those have constant time when averaged over a series of ap…