Live data from Hacker News

I had to give a wrong answer to get the job (2017)

dewitters.com

121–130 of 409 posts

Re: I had to give a wrong answer to get the job (2017)

#121

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 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)

#122
post #98

One 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.

It is sublinear, n is the nth Fibonacci number, or the size of the series up to the desired value. The standard (non-naive) algorithm is linear with respect to n. The matrix version makes use of fast exponentiation which is log(n), using the same n as before the target Fibonacci number.

Re: I had to give a wrong answer to get the job (2017)

#123
post #98

One 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.

It's still O(n) or O(log(n)) as you have to compute the value using exponentiation to the nth power. Which offers either a linear algorithm or a faster logarithmic algorithm if you use fast exponentiation. It isn't actually O(1).

Re: I had to give a wrong answer to get the job (2017)

#125
post #15

Can'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.

In the real world, people have to apply to dozens if not hundreds of jobs just to get an offer. The company has all of the power, so you tell them what they want to hear or you starve.

Re: I had to give a wrong answer to get the job (2017)

#126
post #74
post #55

Earlier 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.

The data layer in a 3 tier architecture isn't necessarily anemic either.

Re: I had to give a wrong answer to get the job (2017)

#127
I 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 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)

#128

Earlier 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.

I’m curious, why do you think that’s ambiguous?

Re: I had to give a wrong answer to get the job (2017)

#129

I 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…

Just a thought -- gaming is latency sensitive. Maybe their issue with it wasn't about average performance, but that the once-in-a-while perf hit would be enough to cause a bad experience for the person playing the game? I know I'd be frustrated if there was a predictable lag spike while playing a game.
Post reply on HN