from Hacker News

In defense of coding interviews

by lilfrost on 5/29/22, 12:08 AM with 381 comments

  • by vorpalhex on 5/29/22, 2:51 AM

    "Can coding interviews work in an ideal world" which is what the article seems to discuss: sure, probably, this seems like a reasonable approach to what that ideal world might look like: a really carefully chosen question and attempting to understand the process the candidate is using to comprehend their skill.

    "Do coding interviews work in the actual world in which we live in?" No, fundamentally not. Almost nobody is sufficiently capable to actually analyze code, and writing code with an audience is absolutely a stupid anxiety inducing high stress situation that makes candidates into babbling children who can't define an array - EVEN IF THE CANDIDATE CAN IN FACT PROGRAM JUST FINE. Add in one idiot on the interview panel who can't stop "tsk"-ing or asking obnoxious questions ("Why did you use a foreach and not a for loop?") and you have an hour long anxiety sandwich where the only thing you are getting from the candidate is whether or not they can dance in front of a sufficiently hostile crowd on demand.

  • by d--b on 5/29/22, 4:07 AM

    The dirty secret is that it’s never about the coding skills.

    It’s about the person’s behavior, the way he/she interacts with you. It’s about the person’s culture, tabs vs space, and that kind of things. And it’s mostly about whether you like the person or not.

    And I think it’s fine. You mainly need to be sure that the person knows what a for loop is, other than that, most people are ok at programming. What really matters is that you can work with that person.

    Unfortunately interviewers who don’t realize this will unconsciously tweak the interview to make it harder for people they don’t like and easier for people they do like. And then they have an “objective” reason to not hire the person: “oh my god, he didn’t know merge sort”.

    I give all kinds of random questions. And many times I recommend hiring people who bombed it, and many times I recommended bailing on ones who nailed it (overconfidence, poor communication, etc).

  • by adam_arthur on 5/29/22, 1:20 AM

    The best coding interviews for 90% of tech jobs are ones that are heavy on coding and light on theory. Very few jobs are particularly well served by somebody with strong theoretical foundations, while most are well served by somebody who can pump out high quality code quickly.

    Yet most companies interview as if they are inventing novel storage/processing mechanisms. Theory is important to understand which tools to leverage when, of course, but not to the extent that it's typically prioritized in the typical interview.

    I've had plenty of people crush the theory portion of the interview and be poor performers on the job (slow coding, low volume output), but I've never had somebody crush the coding portion (implement very fast and proficiently), and perform poorly on the job

  • by angarg12 on 5/29/22, 2:52 AM

    Before we criticize the current interview format and propose alternatives, we need to understand how we got here first. This is my understanding of what happened (I wasn't there for most of this!).

    Leetcode-style interviews became popular in the mid 00s, primarily because they were used by hot tech companies of the time. The thing to understand is that at that time, the idea of asking people to write code during an interview what sort of revolutionary. Prior to that interviews had little structure. It wasn't unusual for the hiring manager to make the decision, some times based on credentials, recommendations, or trivial-like questions.

    This type of interview became wildly popular because it allowed budding unicorns to hire programmers of high quality at scale. The process was less biased than the alternative, reproducible and scalable. Here you have two blog posts [1][2] that show the line of thought at the time.

    The reality is that big tech has elevated leetcode type interview to an art. They have reached a near local optimal through years of experiments and refinements. It is working well for them so they don't have the need to take big risks such as completely revamping their hiring process.

    I love the topic of hiring and interviewing and I'd love to truly get at the bottom of which method works best. I like this article because it explicitly calls out shortcomings with typical alternatives that are not usually mentioned. I hope in the future a new crop of unicorns can take these practices to the next level and do a fair comparison.

    [1] https://www.joelonsoftware.com/2006/10/25/the-guerrilla-guid... [2] https://sites.google.com/site/steveyegge2/five-essential-pho...

  • by dccoolgai on 5/29/22, 2:50 AM

    If I have my Jr. Dev a hard problem to work on and they said "breathe over my shoulder for 30 minutes and I'll have the answer for you" I would be having a serious corrective chat with them at our next meeting. No one works that way. Coding interviews are 10 percent about coding and 90 anxiety management... Which to be clear is important, but let's be honest about what we're filtering for in these things.
  • by tombert on 5/29/22, 2:19 AM

    I used to defend coding interviews, until I had an interview about a month ago, and the leetcode questions came off as kind of insulting.

    I have a decade of experience, working as a senior and staff engineer at megacorporations, have experience as a research scientist, am in a PhD program for computer science research, but lets just double check that I know how to use a hash table.

  • by Apocryphon on 5/29/22, 1:52 AM

    Instead of endlessly rehashing the controversy of coding interviews, has anyone considered just how engineers are expected to be able to understand the material on the interviews?

    Should it be from university CS programs? Which are supposed not to be vocational? And would discriminate against those who are not degree holders?

    Should it be from internships, which are nowadays subject to the same Leetcode examinations as actual work?

    Should it be from junior developer roles, which are an endangered species, as every business in desperate need for seniors, and lack the patience to train?

    Maybe open source can be a sort of free apprenticeship to teach developers these good practices?

    Or maybe grinding away at Leetcode, Project Euler, and arbitrary coding puzzles is really the only pedagogical solution.

  • by andreygrehov on 5/29/22, 3:10 AM

    I used to hate leetcode-style coding interviews, but now I don't. The reason for this is a comment from a Google engineer. That comment changed my mind. In that comment they explained the motivation behind asking these type of questions and it all finally clicked for me.

    Corporations are not testing your knowledge of algorithms per se. While that knowledge is obviously important, what's more important is how dedicated you are when it comes to reaching a goal. Essentially, they are testing your will power. You know the rules. Can you achieve success and not give up in the middle of the road by skipping, say, Dynamic Programming? They could've tested your level of dedication by asking to bake some fancy cake, but throwing CS-related questions just makes much more sense.

    That reasoning completely changed my perspective about algo-heavy coding interviews.

  • by lapcat on 5/29/22, 3:13 AM

    One reason I'm self-employed now is to avoid this whole flaming hoop audition game. Thankfully my customers don't want to test me. At this point I'm tired of arguing against coding interviews, because the same arguments have already been repeated ad nauseam, and the linked article doesn't seem to me to add anything new. I just don't want to hear about any "talent shortage", because too many programmers are being systematically excluded out of fear of the dreaded "false positive".
  • by jfoutz on 5/29/22, 5:02 AM

    I've been asked to interview. I'm not a great interviewer, but maybe OK. I try to figure out if they can work the tools. I'm pretty lax - interviews are stressful and missing a comma can take a minute, I don't like people twisting in the wind over a syntax error and will point it out if I'm pretty sure they'd get there. I try to decide if I can work with this person. I try to figure out if they'd be ok with how things work at my current employer.

    I have two very memorable no's. They were for pretty senior/advanced IC roles. Juniors would get far more slack. I usually ask an expression evaluator question.

    One person, used eval(string). Brilliant, absolutely brilliant. full points for answering, but how do we make sure the string is safe to eval? Long frustrating discussion around regexes that that maybe a junior dev is responsible for maintaining. Man, just write the parser. I know you can do it. Give me something that's something that's not _crazy_ to put into prod. Give me something that won't be a bug tarpit. Sorry man, I loved your answer. I hated your response to how this can be operationalized. Clearly super smart. Maybe I should have given the green light, but the response to criticism was so bad. There are lots of people I disagree with, that I'm happy to work with. I think I made the right choice, but I wonder from time to time.

    Another person I absolutely would have loved to work with, and would have learned a ton. Very into formal methods, or slightly relaxed versions of verifying reliability. My organization at the time was pretty fast and loose. I believed they would be miserable. In the interview I told them I'd give them the green light, but they'd have a huge uphill battle.

    it's so hard to tell. People are adaptable, small mismatches can be papered over, but big mismatches - it's so tough to say. Relaxing and being vulnerable on both sides is so hard to do well. Maybe I was just a jerk. I think I made the right calls, but it haunts me.

  • by drewrv on 5/29/22, 1:44 AM

    It is nice to hear a defense of this style since there’s often so much complaining about it, and the tips to mitigate the downsides are useful.

    Personally I don’t mind a whiteboard session or two during a loop but what’s wild to me is how, especially at big companies, you’re expected to do four or five of these to get an offer.

    How often do these companies decide “well they understand when to use DFS and they can merge-sort a linked-list and they knew to use dynamic programming but we can’t hire them because they couldn’t remember how to implement a heap”?

  • by s1k3 on 5/29/22, 11:42 AM

    The idea of observing someone writing code is a freaking joke. It puts an enormous amount of pressure on the candidate, and it forces the candidate to think and talk deeply at the same time, which in and of itself is a skill that is not never for the job. Coding interviews are a joke and the defense of them is even worse.

    Edit: on further thought. I think I’d be ok with coding interviews if the interviewee got to bring in their own coding question and the interviewer had to do it as well. That way the they also knows the people they are working with can live up to their ideal of a good coder.

  • by drewcoo on 5/29/22, 1:34 AM

    This is not a defense.

    It's saying coding interviews are not spectacularly awful if you (thoughtfully) change them.

    Great! That's what everyone complaining about them has been saying in one way or another all along, change them.

  • by autarch on 5/29/22, 2:56 AM

    I upvoted this because it's well written, even though I disagree with the conclusions. I'm not sure the suggested alternative coding challenges are any better. The text preview one starts ok, but introducing HTML raises the complexity through the roof!

    I wrote about my own experiences with coding challenges during my recent job search on my blog at https://blog.urth.org/2022/04/19/software-job-search-2022-re...

    I'll summarize my conclusion about live coding challenges, which is that I'm not convinced that my performance on these challenges reflected any abstract skill I have. Instead, they mostly reflected the fact that the problems I was given were either nearly identical to work I've done in the past, or were similar enough to things I'd done recently that they felt pretty easy.

    I guess there's _some_ signal in that, but I don't know if it really says anything about how good I am at coding in general.

  • by WalterBright on 5/29/22, 4:44 AM

    If you're augering for a $250,000 job, and the gate is a leetcode interview, just spend a couple weeks prepping for it. It'll be the biggest bang for the buck effort you'll ever make.
  • by Justsignedup on 5/29/22, 2:43 AM

    I usually give a data structure coding interview:

    Here's some data models, and here's how you can reference eachother by properties. Cool. Let's do 3 levels of nested loops to extract the relationships and map them. That's like 99% of what they'll be doing.

    The signals I'd look for are "do they start the entire thing by looking at structures or not", etc.

    But unfortunately this breaks down when you're interviewing 10-year+ candidates. It doesn't yield anything useful. So sticking for those positions with a really really basic problem and pseudocoding it, and using the remaining time to instead have them map out solutions they did in the past seems to be useful.

    Most things leet code interviews screen is "does this person know how to cram" because I tell you, everyone I know who aced leet code interviews crammed for 3 months and literally knew any one you can think of, and every variation. Juniors tend to do better in those, ironically enough.

  • by amitport on 5/29/22, 7:22 AM

    The real reason there are these coding things:

    A) SWEs are shit behavioral interviewers in any other way. You are not about to chnage that even if you are google.

    B) It is crucial that newcomers be hired by their peers and by their direct manager. This has solid research. People hate it when they get an hire and they hadn't a meaningful part in the decision... The new hire is more likely to fail.

    A+B means it is better to have a terrible process lead by SWEs (e.g. coding interviews), than a good one lead by professional recruiters (which will fail, no matter their capabilities and methodology) (and yes, I do believe that without considering A, some non technical recuiters trained at workplace psychology will have a much better success rate without needing any technical interview. They will need someone technical to have a talk with the candidate, but definitely not to ask leetcode etc).

  • by zainhoda on 5/29/22, 5:55 AM

    Software development is really weirdly unique in the way we interview candidates. In no other profession does a job candidate with work experience have to “study” or “practice” for an interview other than reading up about the company. Unless they’re interviewing for their first job, talk to candidates about their experience and dig in to what they actually accomplished.
  • by buro9 on 5/29/22, 9:24 AM

    My view is that a coding interview is not an interview of whether you can code.

    It is an interview about your communication, whether the code you write can be maintained, whether you can inspire/build trust (can you explain what you're doing? does that feel reasonable to the other person?).

    Where people fail is to think that it's a test of experience, or a "heads down I must make every test case pass", that the outcome matters more than the process.

    It's all about communication.

  • by invalidname on 5/29/22, 2:31 AM

    Very well written article despite the fact that I completely disagree with the conclusions logic of the author. I'm on the "reading code" and having a more personal connection side of the road. Partially on the debugging aspect for some cases. Pretty much the process explained here: https://talktotheduck.dev/debugging-the-technical-interview-...

    The "write code" types of interviews fit for juniors who might not know how to even write code properly. If a person doesn't know how to do that and is a junior they usually have the right energy and can put 100% into the job to adapt/learn. I hired such juniors who had no experience in the languages/platforms and were productive within a month. They had good character and discipline.

    Distilling a question like that for an advanced coder is impossible. No wonder the article didn't provide any sample of a "good interview". We'd all burn him at the stake because we'd all hate it. There's no such piece of code that would provide a valuable data point about a candidate. So this is a waste of your time when dealing with a junior and with an advanced coder.

    Coding interviews are difficult. You will make mistakes, this is unavoidable. I think the best mistakes to make are the ones where you hire people who are part of your team and can grow with it. Even if they aren't the best coders around, being part of the team will help them hone those skills and evolve. If I had to pick a 10/10 coder or a team player I'd pick the latter every time.

  • by sys_64738 on 5/29/22, 2:44 AM

    Coding questions are a waste of time. A better interview technique is asking about a problem they solved and drill down on it. This actually is better and allows for a conversation and discussion. I know you can program so don't need to trick you up on it. If you can't then you'll quickly be found out on the job.
  • by jwmoz on 5/30/22, 4:15 AM

    On the last type, I had one where I had to write code for a checkout system with the developer sitting next to me. I hated the pressure and felt very stressed, halfway through the problem I hit a bug and my mind went literally blank, all the map in my mind of variables, flow etc literally went black. I remember it happening and I totally lost myself, ended up looking out the window for a while at the sun shining on a building. Somehow got it back and ended up finishing the task and I remember basically shouting I'd finished and that that was it, I wouldn't do anymore as I was so relieved it was over.

    Got the job.

  • by nowherebeen on 5/29/22, 3:03 AM

    There is also one thing about coding interviews that no one ever talks about: how there are so many bad interviewers out there.
  • by scarface74 on 5/29/22, 4:12 AM

    I don’t know how to feel about coding interviews. I never had a serious coding interview in my 24 year job history between 7 companies from 1996-2020. They were all your standard “dark matter” [1] development enterprise dev jobs.

    Then I did a slight pivot to get into BigTech via cloud app dev consulting - “application modernization” [2] - still with no coding interview although I still do the same type of enterprise/cloud app dev I did in the latter part of my career in the “real world” - and a shit ton of yaml.

    Even in 2020, if I couldn’t have gotten a job at either Azure or AWS, I probably would have done what it takes and practiced to increase my income by an easy six figures or more.

    Coding interviews are a “gravity problem”. You can not like either. But they still exist.

    That being said, if I were starting out today and could break the can’t get a job <-> don’t have experience cycle by “grinding leetcode” for few months and and end up in the top 10% of income earners in the US right out of college, I would have definitely done it and I encourage my younger relatives graduating in CS to do it.

    However, if you’re just hiring for your standard yet another senior CRUD developer and paying as such ($90K-$160K) - don’t expect me to do the monkey dance.

    I think algorithm style coding interviews are the great equalizer. Even though I at 48 probably couldn’t pass one without some serious practice.

    [1] https://www.hanselman.com/blog/dark-matter-developers-the-un...

    [2] yes it’s a full time position with the same compensation structure.

  • by fdschoeneman on 5/29/22, 5:18 AM

    I don't really have an opinion about whether or not programming interviews are useful. I think they probably are useful in most situations. Nevertheless, I suck at them. I don't think I've ever passed one. I'm not even a good programmer. When I ship code, I'm slow. If I get hired it's because someone has seen code I've written in the wild, and it works, and it is clean and readable and well tested -- and because the person hiring can see that I love building stuff.

    I'm finishing up a personal open-source project and am looking for a new position focused on ruby or rails, so if you're hiring and are open to evaluating me based on something cool I've written, hit me up.

  • by mrwh on 5/29/22, 5:22 AM

    Other professions handle this via professional qualifications. Architects - and please do contradict me actual architects! - are not tested on their knowledge of basic architectural concepts as part of interviewing at a firm, because that's what the professional qualification is for. You have done the test already.

    And here's where our industry isn't a "real" profession yet. There are plenty of qualifications one can get, but none that gates the ability to call oneself a software engineer. The result: we have to prove it in interviews.

    And I don't know whether this is better or not. It is different though. The price of not having to sit through exams is to have to jump through hoops.

  • by ankurdhama on 5/29/22, 5:40 AM

    Programming interviews are really important but the questions should not be those about tricky data structure or based on obsecure mathematical trick. IMO the question should be presented in terms of real world concepts so that the candidate can be tested on what data structure they use to model the data related to the problem statement and the problem statement should be simple enough that you can easily come up with a very high level approach yet the implementation would require understadning concepts of conditionals/iteration/recursion. And you should also check how the candidate break the problem into smaller problems (instead of writing a single big function)
  • by NickChasanis on 5/29/22, 12:26 PM

    I agree with this articles ending, what you offer though is a hybrid of pair programming, what we ought to say is that effectively we need to have a conversation, trust me i wont do a coding game with you, ill just ignore you, but a conversation like a human being, that i can do and i'm more than willing, and yes ask me anything because i will ask you too, the interview is a two way process, many of us learned that the hard way, therefore we wont repeat the same mistakes.
  • by gunfighthacksaw on 5/29/22, 1:57 AM

    Perhaps I’m biased as someone with a better than average sense of algorithms and discrete math, but I think such interview questions have a lot of utility, provided the job will require some analysis of algorithms, eg you’re working on the platform, or a solver/optimizer.

    Obviously it’s pants on head stupid to do that if you want a web dev to make a pretty app, tie frameworks together and liaise with 3rd party integrators. However, I think many employers want the crème of such devs who are also good at algos.

  • by Nextgrid on 5/29/22, 11:22 AM

    I think in-person coding interviews (so both sides have skin in the game) are good but the problems should actually be applicable to the task at hand. In practice, this is rarely the case - I'm not sure if it's because there's a shortage of non-algorithm-focused questions or if because every bullshit startup wants to come across as some super advanced software R&D operation while what they ultimately need is a variant of CRUD.
  • by bachmitre on 5/29/22, 3:51 PM

    In my 25 years as a developer I have been sitting on both ends of a coding interview a good number of times. One thing I find coding interviews helpful for is to weed out people that apply for a specific job description (e.g. "looking for experienced python developer", who's resume shows 7 years of recent python experience, but that during a simple coding test have problems getting the syntax right.
  • by endisneigh on 5/29/22, 5:26 PM

    I wonder how well the following exam would correlate to job performance:

    A completely fictitious language is developed. Simple enough that you can become fluent within an hour. From this you read a bunch of problems in said language and must solve them.

    A set of assertions about the problems are written down and you must verify them. Finally a full program, created from a dialect of the given language is given and you try to understand

  • by esoterae on 5/29/22, 2:31 AM

    Please provide proof that a coding interview makes a statistically significant effect on predicting success in a position, all other things being equal.
  • by bfrog on 5/29/22, 4:10 PM

    Ad companies disguised as tech companies seem to love this type of interview.
  • by parentheses on 5/29/22, 8:51 AM

    It's interesting to see this occupy the same front page as:

    https://news.ycombinator.com/item?id=31544634

    How do you test knowledge indeed?

  • by WalterBright on 5/29/22, 4:38 AM

    Coding interviews are because of cheaters and frauds:

    https://news.ycombinator.com/item?id=31544634

  • by langsoul-com on 5/29/22, 11:14 AM

    I'd summarise the article as such. Fizz buzz like coding coding interviews are best. Looks at how the interviewee codes not just now, but in the future as we.
  • by eyelidlessness on 5/29/22, 7:53 AM

    > Be careful of anything requiring recursion, it’s not super common to use it in practice

    Lol be careful not to ask for a loop, nobody uses loops in real programming problems

  • by mouzogu on 5/29/22, 1:39 PM

    nice if i could just get a job on my experience alone. don't enjoy coding, idea of a test or leetcode is tiring to think about.

    dont mind talking over code casually but dont put me on the spot or give me homework. not doing that.

  • by danamit on 5/29/22, 1:29 PM

    The real issue is "continuous recruitment" imo.
  • by csydas on 5/29/22, 9:28 AM

    > Don’t ask “trick” questions, like anything where you have to use an obscure data structure or algorithm in a clever way (or dynamic programming).

    I just want to put this out there to anyone who gets involved in interviews that this is a very important rule -- if your question can basically be redefined as some really clever solution you found on a problem you put > 30 minutes into, it's probably not a good question.

    A lot of the seniors I work with would come up with questions like this, and I get their logic:

    1. I'm a senior and this was a challenge for me 2. The logic is clear when you see it and look at it 3. I want people who can do work similar to me 4. I know how to get to the conclusion, so I can judge based on the path the candidate takes Conclusion: It's a good question

    While I understand how we can get to such a conclusion, I think that in most cases the only takeaway you can get is "can this person think like I did in this situation?", which maybe has some value for judging workplace compatibility, but I don't think it's a fair assessment of someone's technical aptitude. If you yourself required a lot of time and brainpower to sort through a tricky issue like this with the benefit of the problem scope and system needs that led to this issue, it's very unlikely you'll be able to judge any assessment

    Point 4 seems good at first because we can say "the goal is to just see them think and use their experience"; there is truth to it but without the rest of the context it's not really a good assessment because ultimately, you're looking to see "did you get the same conclusion I did? Did you avoid the same pitfalls I hit?"

    Instead, focus on a general scenario that tests their understanding of basic principles. How do they use the fundamental knowledge for the subject matter to work through a new problem that you yourself haven't really dealt with. It removes your bias a bit and opens you up to those "wow why didn't I think of that?" moments that you'd have working on tough projects together.

    Try your best to give a good faith interpretation to any path the candidate takes and help take it to natural conclusions, and see how the candidate reacts; if you can see they've made a workable but problematic solution, nudge them towards the problems you see and see how they discuss it.

    For me a candidate that can really process their own thoughts and do a good analysis of their own solution (its benefits and shortcomings) is extremely valuable; I usually lead off with "I know how I'd do it, but that doesn't mean it's the right answer, so focus on your strategy and walk me through it." If you want tot test compatibility or you feel you have a stronger solution, accept their solution (if it's valid) then go ahead and discuss your thoughts a bit and see how they respond and how they discuss it. The more you make it a technical conversation against peers and less a university exam, the more you have to see how they think and operate and the better you can understand them.

  • by woeirua on 5/29/22, 2:14 PM

    Stop defending whiteboard interviews. We know [1] that they are inherently biased against certain groups and have a very large false negative rate.

    It amazes me how many people will defend the current interviewing process and then openly admit that the majority of their engineers could not pass the same process without spending dozens of hours preparing.

    [1] https://news.ncsu.edu/2020/07/tech-job-interviews-anxiety/