Earlier quoted context omitted.
> It's not great to have to double your memory usage while you reallocate your array. You don't have to use a growth factor of 2. Any constant multiple of the current size will give you amortized constant complexity. > 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…
When you reallocate your array you will in memory have your old array and your new larger array while you move your data over. At the very least you're using 2x and the extra memory for your expansion. For your other points if you'd mentioned them in the interview you'd probably have been better received. Copying is really only that fast for POD objects (your objects copy constructors may need to do reallocation them…
I had to give a wrong answer to get the job (2017)
251–260 of 409 posts
Re: I had to give a wrong answer to get the job (2017)
#252I 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…
Re: I had to give a wrong answer to get the job (2017)
#253Earlier 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…
Certainly over longer distances and highway driving, driving faster will get you somewhere faster. In city driving though, where most people drive, it is correct that speeding up for certain portions of the journey will not get you there faster since the increased speed over short spurts can't make up for congestion, stop lights, etc.
But it does slow your reaction time, and it does massively increase your accident risk. And that's couched in, "And now it's going to take many many more minutes for another unit to get to your patient than the few seconds you'd have saved".
Re: I had to give a wrong answer to get the job (2017)
#254Earlier quoted context omitted.
All great until you come across someone with a permanent poker face. During my last interview, the interviewer was frowning the whole time.
I once got two raises in an interview because I was so (pleasantly) surprised by the size of the first offer that I wasn't sure what to say. There was a bit more to this situation - I liked the job I was in and the employer really needed someone, but it was still a revelation. Keeping your mouth shut, saying no, and not lying or BSing are three of the most useful skills you can develop. Many people feel pressure to r…
Just pausing and not answering quickly when given an offer is a power move. I know it consciously but I still find it hard/impossible to do in real life.
Re: I had to give a wrong answer to get the job (2017)
#255I was once asked to write a function that, given the time, draw an analog clock. Given the nature of the position I was applying for, this wasn't an unreasonable question. I wrote something on a whiteboard. What followed was the most surreal discussion I've had in an interview. My function took into account the seconds, minutes and hour for the hour hand, and so on. Just like a normal clock would. The interviewer ins…
Lots of us didn’t fully understand the question when we were giving it initially and it caused a lot of problems. I’m guessing you had the minute hand drawn as if it moved continuously since you mention seconds.
Let me apologize for either myself or my company :)
Re: I had to give a wrong answer to get the job (2017)
#256Re: I had to give a wrong answer to get the job (2017)
#257This article is pointing out that interviewing/recruiting is as much dominance play for the interviewers as it is testing of candidates. Doing interviews can be considered recognition of rank inside the company. Some probably consider this sanctioned "lording" an implicit reward, and thus will make sure they get they what they want. Some consider it a hazing ritual. Noting how many comments here are of the form "this…
The article demonstrates an interviewee skillfully maneuvering around their interviewers. It undermines the dominance display which, judging by the comment section, more than a few folks enjoy but also don't want to admit to enjoying.
I'll go a step further and say the desire for dominance in this scenario stems less from avarice and more from insecurity. A new face who who does their job too well, and knows things that the interviewer does not, is someone who can replace the interviewer.
Re: I had to give a wrong answer to get the job (2017)
#258I was once asked to write a function that, given the time, draw an analog clock. Given the nature of the position I was applying for, this wasn't an unreasonable question. I wrote something on a whiteboard. What followed was the most surreal discussion I've had in an interview. My function took into account the seconds, minutes and hour for the hour hand, and so on. Just like a normal clock would. The interviewer ins…
I'm fairly sure I left them convinced I didn't understand my own research.
Re: I had to give a wrong answer to get the job (2017)
#259I 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…
Of the many scenarios where amortized complexity is not okay, code in a tight loop where predictable performance is key, e.g. code running game logic, jumps immediately to the top of the list. The fact that you were unable to incorporate this into the conversation makes me suspect you were more interested in putting on a show than a practical solution to the task at hand. The worst case performance for a dynamic array is O(n), but the amortized performance is constant. They aren't the same thing.
You may be a different, more mature, engineer nowadays. But, when I encounter the type of persona your story describes I tend to respond with strong no’s irrespective of whether you have since written a textbook.
Re: I had to give a wrong answer to get the job (2017)
#260If SNL were to call you and offer you a job while you were working for us, would you take it?
I know what they wanted me to say but I thought it was a pretty dumb question. So I said:
Of course I’d take the job with SNL, but I didn’t move to this city for stand-up comedy, that’s just a side hobby.
I did not get the job and I guess they were looking for someone more dishonest.