Live data from Hacker News

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

dewitters.com

151–160 of 409 posts

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

#151
I think a lot of people have had the experience of giving the right answer and have the interviewer believe it's wrong, whether they are wrong or the interviewee didn't explain it well enough. I've done both. In one case, I make a flippant comment about how you don't really know where the bottlenecks in your software are unless you measure. I was making a statement which I believed the other person would simply agree with as a baseline. However, he took it as a challenge and said, "I know where our bottlenecks are". Oops.

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

#152

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…

Couldnt you show them example on e.g whiteboard how it'd work? it'd be huge pros that you can explain concepts to people who do not know them in 5mins.

I was on a whiteboard, but the social cues I was getting from them made it pretty clear that even my attempts to explain were just digging myself deeper into a hole in their eyes.

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

#153
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.

If you're computing the time complexity this way, then the simple linear dynamic programming is actually quadratic, and the matrix exponentiation algorithm is still faster.

Generally I would assume that multiplication and addition are constant time for big-O analysis, until given a reason otherwise. That might be less appropriate for fibonacci than most other problems though.

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

#155

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…

Why didn't you just say "...or, you could use a linked list" when you notice them doubting your first answer?

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

#156
post #129

Earlier quoted context omitted.

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.

No, latency didn't come up. (I agree that could be a reason not to use a dynamic array.) They were hung up on the idea that a dynamic array must be O(n) because at least some of the appends copy.

Assuming you can average over all requests imposes that latency does not matter, doesn't it?

If you're the interviewee, it's up to you to get that clarification

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

#157
post #136

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…

In some cases amortized isn't good enough though, and games could certainly be one of them! (Anywhere you're servicing some kind of interactive request might qualify, depending on this size of your datastructures.) This is actually something I like to work through in interviews: OK, you've got amortized-constant-time append to your array-backed colletion, but now what if we need it to be really constant time? How cou…

>> In some cases amortized isn't good enough though, and games could certainly be one of them!

Real time systems including games have hard limits on how long something can take in the worst case, not the average. In games this manifests as: All the stuff has to be done in 16ms to render a frame on time, if we're late the user will perceive a glitch. The consequences can be worse in control systems in any number of real-world systems where a glitch can lead to stability problems.

So getting back to TFA, this is part of knowing what the "right" answer is for the context.

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

#158

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…

[deleted]

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

#159
> But then I saw him frowning, and so knew this was not the answer the was expecting.

This is why, as a blind person, I'm fundamentally screwed when looking for a job. I suspect situations like this contribute greatly to the 70% unemployment rate in the blind community.

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

#160

Earlier quoted context omitted.

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.

The job application process varies immensely by position and profession. For a junior developer there are hundreds of new listing each day but hundreds of qualified people applying, so the company has all the power and your comment would be true in that context. For a very qualified senior dev, there are dozens of positions posted each day where the company is truly set back until the role is filled, with only a handful of qualified people applying, so the senior dev has a lot of power.

In another profession like say a specialized electrical engineer, there may be only a few positions posted a month and a handful of qualified people so both the engineer and the company would be desperate that they could together be a fit.

This story was about an anecdotal experience where the power dynamic was fairly equal

Post reply on HN