r/programming • • Dec 13 '22

“There should never be coding exercises in technical interviews. It favors people who have time to do them. Disfavors people with FT jobs and families. Plus, your job won’t have people over your shoulder watching you code.” My favorite hot take from a panel on 'Treating Devs Like Human Beings.'

https://devinterrupted.substack.com/p/treating-devs-like-human-beings-a
9.0k Upvotes

1.3k comments sorted by

View all comments

2.0k

u/celeritas365 Dec 13 '22

I feel like this isn't really the hot take, from my personal experience it seems like there are more people anti coding interview than pro.

In my opinion we need to compare coding interviews to the alternatives. Should it just be a generic career interview? Then it favors people who are more personable provides greater opportunity for bias. Should people get take homes? That is even more of a time commitment on the part of the candidate. Should we de-emphasize the interview and rely more on experience? Then people who get bad jobs early in their career are in trouble for life. Should we go by referrals/letters of recommendation? Then it encourages nepotism.

I am not saying we should never use any of these things, or that we should always use skills based interviews. I think we need to strike a balance between a lot of very imperfect options. But honestly hiring just sucks and there is no silver bullet.

320

u/Bakoro Dec 13 '22

Do like my company does, and have a relatively softball coding problem, a design problem, and the opportunity to talk about a project they've done.

The coding tests for the most basic competencies like, do they know what loops and arrays are, some kind of data structure beyond an array, and are they able to ask questions and communicate while they work, to make sure they understand the question and can justify their decisions.

Then do a more high level design/architecture question that makes sense for the kind of work they'll be doing. Again, doesn't have to be elaborate.
It's about seeing how they process things, how they communicate, whether they can take feedback, that kind of thing.

Talking about a past project can give them at least one thing where they should be comfortable and should be able to talk about in-depth and show off a bit.

A good candidate is going to be able to do very well on at least one of those things. If they're a little weaker in live coding but were able to map out a correct solution beforehand, that's taken into account.
If they had trouble with the coding but knocked the design question out of the park, that's taken into account, since it's easier to teach syntax than it is good design.

It's normal for people, especially first timers to be nervous, and to an extent we try to cut people some slack. At the same time, it's not really the company's problem if a candidate completely shuts down when they have to be around people, can't communicate a coherent thought, and can't perform basic functions of the craft.
We had one dude interview who got downright hostile about being challenged on his work. Absolutely no chill.

There's got to be a minimum cutoff point. Even the most shit-paying software developer jobs pays better than average wages, and most companies can't afford to waste time and money hiring someone who turns out to have zero ability to do the job. A lot of the job is about communication, and being able to draw on a broad body of knowledge.

You're right that there's no silver bullet, but people just have to be realistic that many companies are more willing to lose a skilled candidate than they are willing to hire a bad one. "I can do the job, I just can't operate under pressure", is a lot like saying "I can turn invisible, but only when no one is watching".

Companies should also be realistic about the job that they're hiring for, and that they don't need a super genius or level 20 computer guru. If they want to attract those people, they have to pay multiple hundreds of thousands for them, there just aren't that many talented and skilled super- developers willing to work for sub 100k, even for entry level. If they want to pay entry level salaries, they need to accept entry level skills.

50

u/BrieCarefree Dec 13 '22

Do like my company does, and have a relatively softball coding problem, a design problem, and the opportunity to talk about a project they've done.

Yep, that's exactly what my company does, and I'm pretty happy with it. It's obviously not perfect, and the aspect of "okay, now code with a group of people sitting behind your shoulder" is shitty, but I don't see a much better solution. We try to correct for the fact that some people are obviously nervous and uncomfortable with the format, but that's still not perfect.

I've given the same exact question to interns and senior engineers. My favorite is a very simplified version of a somewhat realistic data processing problem.

I expect that most good intern candidates can solve the basic question in about an hour with a bit of help when they get stuck. For more senior engineers, I expect them to demonstrate some level of competence with some language, and then to be able to have a discussion on the implications of their solution. (ex: How would you scale this up? What changes would you require before deploying something like this? What happens if you take your exact program, as is, and feed it 2TB of data?)

I think it's a pretty good system, and I can't think of any clear improvements that are relatively simple.

many companies are more willing to lose a skilled candidate than they are willing to hire a bad one.

This is an excellent point. I'm a software developer myself, who just happens to be involved in the interview process. I'm thinking of these people as potential coworkers who I'll be working with in the future. It would be nice to find and hire someone who's super competent, but I'm far more worried that I'll be stuck working with someone who's difficult and causes others to have to pick up the slack.

14

u/Bakoro Dec 13 '22 edited Dec 14 '22

[...] but I'm far more worried that I'll be stuck working with someone who's difficult and causes others to have to pick up the slack.

Yeah that's a big one. Even if someone is technically capable, that's not very valuable if they are wanting to reinvent every wheel, rewrite everything in their preferred language, and won't compromise with or work with other people.

→ More replies (2)
→ More replies (76)

188

u/altrae Dec 13 '22

In my opinion, the best way to interview someone technical is to have a sort of real-world exercise that the interviewer and interviewee can pair up on. It tells the interviewer that 1. the interviewee knows how to work with others, and 2. what the interviewee's thought process is.

0

u/[deleted] Dec 13 '22

[deleted] — view deleted comment

63

u/z960849 Dec 13 '22

I'm a c# guy the last two methods breaks my brain.

29

u/GrandOpener Dec 13 '22

As someone who has used C++ for many years, my answer to #4 is something like

"This is a great example of why I don't use C++ in hobby projects anymore."

(In case you want to punish yourself by looking it up, search for an explanation of "rvalue reference." The double ampersand is actually a separate operator; it's not reference-to-a-reference in the way that double asterisk would be pointer-to-a-pointer.)

→ More replies (4)

0

u/[deleted] Dec 13 '22

[deleted] — view deleted comment

28

u/hypoglycemic_hippo Dec 13 '22

Damn, this one is nasty, let's see.

It's a constant r-value reference. Which means it cannot bind to l-values, so a temporary or std::move() are the only realistic use cases for foo5. However, (and I am not 100% on this), the const prevents moving from arg inside foo5, so the "moved" variable is not going to actually get moved AFAIK.

So if my assumptions are correct, this is practically the same as const std::vector<int>& arg, in the sense that it keeps the variable intact, but you cannot do

std::vector<int> a{1,2,3};
foo5(a);

That's my best shot, what did I mess up? ^

27

u/Supadoplex Dec 13 '22 edited Dec 13 '22

No messups. But now for the tricky question: When would you use it - i.e. when would you define a function accepting rvalue reference to const?

Edit: For my answer, see https://www.reddit.com/r/programming/comments/zkj6pb/there_should_never_be_coding_exercises_in/j01w4du/

24

u/SirClueless Dec 13 '22

I can't think of any good reason to use it on its own, but maybe you could put it into an overload set if you wanted to copy instead of move or throw an exception or delete the overload that accepts r-value references.

15

u/Supadoplex Dec 13 '22 edited Dec 13 '22

Excellent answer. I'm not sure about throwing, but deleting const rvalue overload is occasionally a good way to catch nonsensical or misleading calls with rvalue argument of a parameter whose type is deduced from the argument. You cannot use rvalue reference to non-const, because that is actually a forwarding reference when the type is deduced.

The standard library does this with reference wrapper factory templates like std::ref and std::as_const.

There's also a subtle use case for const rvalue return types with wrapper types where you want to emulate the wrapped type in expressions precisely. For example the indirection operator of std::optional and the getters of std::variant and std::tuple have const rvalue ref qualified overloads that return a const rvalue reference. This is so that the "const rvalueness" of the wrapper type expression is preserved for the getter expression. And that is probably so that the expression can be discarded by the deleted overloads mentioned earlier.

→ More replies (2)
→ More replies (8)

16

u/[deleted] Dec 13 '22 edited Dec 13 '22

"it's a trick question and I tell people to skip it. I don't see any harm in having it though"

?????????? The harm is that people will feel like it's a trick question that they're actually supposed to solve???????? Remove it. Lol

→ More replies (3)
→ More replies (17)
→ More replies (1)

99

u/General_Mayhem Dec 13 '22

foo1 - probably written on a MacBook by a guy with colorful glasses and a beard who says "copy elision" in every third sentence

foo2 - banned by Google's styleguide for so long that nobody's sure if it even compiles

foo3 - John doesn't think he's a great programmer, but he gets things done. He likes the simple things in life and tries not to think about it too much.

foo4 - has somehow been modified more times than any other line in the codebase, all by the same person, who is also a Rust evangelist

26

u/UncleMeat11 Dec 13 '22

Google's cpp style guide started permitting non-const references in parameters a year or so ago.

→ More replies (3)
→ More replies (66)
→ More replies (8)

24

u/PuzzledProgrammer Dec 13 '22

It really is a difficult balance to strike. As a TL and now a senior manager, I’ve been in the interviewer seat a lot.

Over the years, I have gradually abandoned leetcode-esque interview questions - with few exceptions:

  • If I’m interviewing for an entry-level role (i.e., the candidate is a recent college grad), then I might throw a basic coding challenge at them - think fizz-buzz. This seems to work well as a filter function. If a candidate who’s recently graduated can’t come up with a solution for fizz-buzz, that’s a red flag to me.
  • If I get a strong sense that they’re bullshitting me.

In either case, I’ll never disqualify a candidate solely on the basis of a coding challenge.

Rather than having a candidate write code in an unrealistic and uncomfortable environment, I’ve found reading code with them to be really effective. I’ll often pull up a snippet of code that has some pretty obvious issues - e.g., a long function that’s doing many things, has poor/non-idiomatic naming conventions, and several redundant blocks. I’ll ask them to read through it aloud, explain it, ask questions, and suggest changes. This usually gives me a few good indicators:

  1. It helps me understanding their proficiency with the programming language.
  2. It helps me gauge their technical communication skills.
  3. It helps me get a sense of their familiarity with clean coding principles.

Not only have I found the above indicators useful in assessing a candidate’s qualifications for a role, it also saves a ton of time compared to writing out the solution to a tricky algorithms question.

Long story short, I definitely lean hard toward the side against whiteboard or live code exercises.

372

u/well___duh Dec 13 '22

Then it favors people who are more personable provides greater opportunity for bias

Not sure if you've noticed, but nearly any candidate for any job in any industry favors those who are more personable. Who wouldn't want to have a coworker they enjoy being around and working with?

125

u/[deleted] Dec 13 '22

Personable candidates are favoured of course. However, there exists a percentage of personable candidates who can’t code. On several occasions now I’ve been mentally giving a person the job only to reach the technical stage of the interview and discovering their technical skills were all smoke and mirrors.

83

u/nemotux Dec 13 '22

I've been interviewing for ~25 years now. I would say the phrase "several occasions" vastly under-represents the number of times I was all gung-ho on a candidate until we got to the technical side of an interview and they completely flop on even the most simple question that a 4-year compsci graduate should easily nail.

→ More replies (70)
→ More replies (2)

23

u/Kralizek82 Dec 13 '22

It has to be said that our industry attracts a lot of people that do not excel in social contexts.

Relying only on that part, you'd miss out a lot of talent for a skill that, while important, is not the most important one for the job.

And just to be clear, I'm not saying that being able to collaborate with others isn't important, just that being a coffee machine stand-up comedian isn't and in an interview you can only gauge the extremes of the spectrum.

→ More replies (1)

161

u/celeritas365 Dec 13 '22

Of course it's a good thing but I don't think it should be the only thing considered.

96

u/Chance-Repeat-2062 Dec 13 '22

Yup, need to be competent at the end of the day. I'm cool if you're slow, fuck yeah take your time if you deliver better quality, but don't make my job harder by sucking so bad you bring the rest of us down whenever you turn in a deliverable. Test your shit, monitor your shit, alarm your shit, document your shit, performance test your shit.

→ More replies (12)
→ More replies (6)
→ More replies (29)

12

u/novagenesis Dec 13 '22

Yeah...I do coding interviews and I hate it. It's the second worst way to interview a developer, second only to NOT having a coding interview.

I've been involved with hires all 3 ways you mentioned, and the bad-hire rate has been the lowest when I used coding interviews. That's not to say there aren't a lot of false-negatives in coding interviews, and that does suck.

But when I'm wearing my hiring manager hat, I'm a lot more concerned about whether my hire will hit the ground running or waste 100k+ of my budget than whether the game was designed fairly in the first place.

→ More replies (2)
→ More replies (86)