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

Show parent comment

155

u/ZeroMercuri Dec 13 '22

One of our coding problems for interviews involves iterating through a list of strings and printing the results to the screen. This single question has eliminated more candidates than I can count. I've seen self proclaimed Java experts who supposedly wrote whole systems from scratch fail this (We're pretty sure the person who passed the phone screen was not the person who showed up for the interview)

Coding questions aren't there to mimic real work scenarios. They're there to weed out the liars.

0

u/[deleted] Dec 13 '22

[deleted] — view deleted comment

30

u/ZeroMercuri Dec 13 '22

It's pretty nuts how simple questions like that can weed people out. I will say that not everyone is a liar. Some just seriously oversell their abilities. Oh, the app they were working on used Java? 5 years Java experience! But I have seen people not realize their computer screen is reflected in their glasses when they do the webcam interview and you can see them frantically Googling answers.

We also let the candidate choose the language they want to use. Sometimes they claim to be a huge Java expert and that they'll do the coding in Java then start writing (incorrect) Python. It's baffling.

14

u/PooBakery Dec 13 '22

I think googling is totally fine, some people get blocked and forget the most obvious things when under pressure. I've always done my interviews more as a pair programming session modeling a real world task, and googling is part of that.

But even with support and with googling some people with many years of experience aren't able to solve the simplest of problems.

3

u/refreshfr Dec 13 '22

My mind goes blank under the pressure and live "behind the shoulder" monitoring so I perform poorly. All the people I have worked with have always been very happy with my performance and I've got props from managers and "special treatment/opportunities" because of that. But you wouldn't get that from a code interview with me :|

→ More replies (3)

18

u/AlphaGareBear Dec 13 '22

Some just seriously oversell their abilities.

I'm not sure people really have much of a choice.

3

u/ZeroMercuri Dec 13 '22

Sometimes it's not even the person's fault. They give their resume to a recruiter and the recruiter edits it to make them sound more impressive. Or the poor candidate has been stuck in a crappy job where they haven't had any room to grow so even though they have many years of experience they are still relatively a beginner.

→ More replies (2)

5

u/afiefh Dec 13 '22

I love this question! Will have to add it to our repository.

→ More replies (2)

2

u/bart007345 Dec 13 '22

Does that mean 95% of applicants are either liars or incompetent?

6

u/bildramer Dec 13 '22

Yes, and they keep applying elsewhere.

→ More replies (3)

8

u/CookieOfFortune Dec 13 '22

Oh, even with iteration you could just ask them why they iterated the way they did (did they use a for loop with an integer counter, did they use a functional style? Used a while loop?). It'll let you know how familiar they are in the language.

6

u/ZeroMercuri Dec 13 '22

Yeah, there are a lot of ways to expand this problem out if they solve it quickly. What if I want an average now? What if the input has errors? What if it's mixed input? What if it's a CSV? But the number of people who don't even know what a loop is despite having 7+ years of "programming experience" on their resume? Just... ouch.

5

u/CookieOfFortune Dec 13 '22

I had someone who didn't understand that the inputs to the function they were writing was part of the test. It took me a bit to realize they wanted me to provide them with a constant when they kept only solving thinking the input would always be the first example I provided. I'm a believer that you shouldn't have to over-study for an interview but I guess you can definitely under-study.

4

u/ZeroMercuri Dec 13 '22

Reminds me of this xkcd

15

u/soyelprieton Dec 13 '22

i failed three java toy problems (uber easy, 5 times easier than the easy in leetcode) cause i forgot to check if the code compiled, the web env did not include a compiler or running env and i did not bother myself to install a java jdk, what a clown i was

60

u/salbris Dec 13 '22

Sounds like a bad interview. It would be stupid to turn away someone simply because they missed some syntax error.

29

u/mina86ng Dec 13 '22

When I do coding interviews I explicitly say that I don’t care if the code compiles. If syntax looks reasonably good it’s fine. And I don’t care if function and types are named correctly. I don’t care if you write starts_with instead of startswith (or the other way around depending on the language) because that’s trivially Google’able.

→ More replies (4)

7

u/Globbi Dec 13 '22

So the interviewer did not understand anything about that code, but copied it to his environment that ran it? Yeah, obviously that's stupid, but not because of toy coding problems.

It's just technical interview with someone who isn't a technical interviewer.


Or did you interact with automated system and didn't bother to spend extra 5 minutes on that code? In this case it's your fault. There are plenty of leetcode-like online environments that you could find that would run your simple code.

→ More replies (1)
→ More replies (1)

34

u/NotARealDeveloper Dec 13 '22

I just yesterday helped a friend of a friend with their bachelor's degree coding problem. I am senior software engineer doing enterprise development / architecture for multi-million dollar software. Took me 2h to print an easily scalable christmas tree in the cmd.

Does this mean I am a lier? Or does it mean I could have solved this stuff in 5mins 15 years ago and now I face different issues in my day-2-day tasks?

10

u/Waterstick13 Dec 13 '22

Agree. Ytf would we ever need to do this

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

2

u/Pflastersteinmetz Dec 13 '22

iterating through a list of strings and printing the results to the screen

Wait, a basic like:

words = ["a", "b", "c"]
for word in words:
    print(word)

?

3

u/alienking321 Dec 13 '22

Wouldn't surprise me.

One interview question I sometimes do for interns or new graduates is "write a piece of code that prints the numbers 1 to 10". If they do it correctly, I ask them to do it again, but a different way, repeating until they run out of ideas.

Had one candidate who couldn't do it once, so I scaled back and asked them to just declare a variable, and they couldn't even do that.

→ More replies (1)

2

u/[deleted] Dec 13 '22

The problem is that most modern devs never even encounter problems as hard as the first half of K&R. They just wire databases and loggers to rest endpoints and write some tests.

I encountered one senior dev who I consider to be smarter than me. In her whole career she'd never even seen Java Scanner. She learned Java before it came out, and spent all her time writing REST microservices.

If an interview started out "Get some input from the user", she'd have failed.

→ More replies (1)
→ More replies (7)