Live data from Hacker News

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

dewitters.com

161–170 of 409 posts

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

#161

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.

Well - not true for all industries. In some, there’s a lot of competition for candidates.

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

#162

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 game dev, that one copy might cause a frame drop. Even if amortized over time the frame rate would be slightly higher, the occasional dip might make it unplayable.

Of course, arrays have better cache locality, but they didn't ask about that.

They were probably looking for a linked list with a small array in each node, which gives more constant write performance and less cache misses on read.

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

#163

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…

Interestingly, you can use scheduling to make a non-amortized dynamic array. Your probably know this, but for other commenters who do not— Keep two arrays, of size n and 2n. Initially the first has capacity c = n/2 and the second has capacity 0. Reads go to the first array. When you append, append one element to the first array, and copy two elements to the second array. By the time the first array is full, it has be…

[deleted]

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

#164
post #124

At one of the Big Four advisory firms we were only allowed one-on-one interviews. I was never able to get a satisfactory answer for this rule. Now I wonder if it was designed to prevent this specific scenario.

They may have a different answer, but the explanation I've gotten for one-on-one interviews is that it prevents the "grilled by a panel" kind of feeling. (I wouldn't know since I've never been in a panel interview.)

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

#165

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…

It's not great to have to double your memory usage while you reallocate your array. On more limited devices (see games consoles or mobile devices) you'll end up fragmenting your memory pretty quickly if you do that too often and the next time you try to increase your array you may not have a contiguous enough block to allocate the larger array.

There's also the cost of copying objects especially if you don't know if the objects you're copying from your original array to the resized array have an overloaded copy constructor. Why copy these objects and incur that cost if you can choose a datastructure that meets their requirements without this behaviour.

If you're holding pointers to these elements elsewhere re-allocating invalids those, and yes you probably shouldn't do that but games generally are trying to get the most performance from fixed hardware so shortcuts this will be taken, its a least something to talk about in the interview.

I can see why they were confused by your answer as its really not suited to the constraints of games and the systems they run on.

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

#166

Earlier quoted context omitted.

Can you link the textbook? I'd be interested in reading it.

I talk about dynamic arrays in Crafting Interpreters: http://craftinginterpreters.com/chunks-of-bytecode.html#a-dy...

i really dig the art style of your diagrams! playful and clear

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

#167

Earlier quoted context omitted.

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.

Well - not true for all industries. In some, there’s a lot of competition for candidates.

We don't even need to look at other industries. It's demonstrably not the case for professional software developers at the moment. The companies are simply doing whatever is in their best interest which is retaining expensive and hard to hire for talent, ergo they'll treat you nicer. The second it's no longer expensive or hard to hire, things will take a turn for the worse (for the candidates).

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

#168

Earlier quoted context omitted.

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.

What's ambiguous about it? Two meters behind a car at highway speeds can get you killed. If it were a question only about cars at rest it would be phrased something like "how far behind a car should you stop when queued" or something of that nature.

There are few places in India where you can drive at "highway speeds".

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

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

I really love this kind of thinking. This isn't the first time I have happen upon it, but I really like the idea that the work I do for a company is an exchange in which both the company and I get something out of it.

Certainly when I got my first job I felt like I was there to take a job, not seeing if the company was a good fit.

Post reply on HN