r/programming • • Mar 01 '17

Programmers are confessing their coding sins to protest a broken job interview process. “Whiteboard” interviews are widely hated. They also discriminate against people who are already underrepresented in the field.

https://theoutline.com/post/1166/programmers-are-confessing-their-coding-sins-to-protest-a-broken-job-interview-process
1.0k Upvotes

717 comments sorted by

View all comments

Show parent comments

24

u/beginner_ Mar 01 '17

Whiteboard interviews are like anything else. They can be better, they can be worse. If your interviewer actually cares that you don't remember how to find the length of a string, they're bad at interviewing. Every interviewer I've ever had, I would simply say (as I'm writing): so I get the length of this string in python, I forget the function, but let's just say s.length()... And that would be it. Nobody would care.

Maybe so but why do I need to know bubble sort, merge sort, whatever sort or algorithm by heart? It depends on the task you need to do on the whiteboard. Who actually writes sorting algorithm from scratch?

27

u/yellowjacketcoder Mar 01 '17

If your interviewer wants you to write bubble sort from scratch, they're a shitty interviewer. Nobody does that outside of CS101. They should be asking some reasonably difficult problem like "given a list of students, find the valedictorian and salutatorian" or "write a system to evaluate poker hands" or "Given a formula for creditworthiness, determine how much of a mortgage to offer someone". Obviously nobody is going to write production ready code in an interview but you get to see them approach a problem, where they make assumptions and where they ask questions, write out some simple algorithm, and you have a pretty decent idea of what kind of coder they are.

20

u/cogman10 Mar 01 '17

Yup.

And frankly, a large number of applicants fail fizzbuzz esq problems.

When I interview, I expect almost nothing from my interviewees. When it is a shared coding website, I'll even go in and fix minor syntax mistakes/problems for them to get their code to compile. I don't care at all that they don't know every method that exists in whatever language they are using. Heck, I encourage them while interviewing to feel free to google that shit. (and I let them know if they are using a language I'm unfamiliar with, "hey, I'm googling it now".)

The most important thing to me is always "Can you code". Not "Do you have an encyclopedia of knowledge about the standard library and the syntax tree".

And like I opened up with, many, MANY people fail the most basic of coding problems. Problems that have no tricks, no special knowledge requirements, that are basically "Here are the requirements, write code".

An example problem "Merge 2 sorted arrays". Though with a lengthy description and example input/output. A shockingly large number of people simply can't do that.

3

u/uber_neutrino Mar 01 '17

Yup. Many people fail the absolute most basic requirements. Fizzbuzz isn't a programming test, it's an idiot filter. I would be embarrassed if I brought someone on site who couldn't solve that which is why I phone pre-screen.

2

u/rabidstoat Mar 01 '17

I believe it. Where I worked in the early 90s had some toy problem like that. At least half the people utterly failed, and another quarter had issues along the way. Some of which was nervousness I'm sure, but....

6

u/cogman10 Mar 01 '17

And that is why I don't really like when these "Whiteboarding is evil" articles come up.

Can they be annoying? yes. Can they be stressful? yes. But are they really effective in, at very least, weeding out really bad candidates? Absolutely.

I support the idea of easy coding tests. Harder ones are more dubious in their benefits. But easy ones are practically essential to keep you from potentially making really bad hiring decisions. I have a hard time sympathizing with someone who can't code up fizzbuzz under pressure.

1

u/IbanezDavy Mar 02 '17

The goal should be 'can they program'. Whiteboarding I feel does that.

7

u/uber_neutrino Mar 01 '17

It's not about writing them from scratch, it's about whether you understand them and know when to use them. Which is why a discussion around big O makes more sense than having people code on a whiteboard.

→ More replies (12)

5

u/D3gr33 Mar 01 '17

why do I need to know bubble sort, merge sort, whatever sort or algorithm by heart?

If it's an obscure algorithm, then you're right, that's a bad way to gauge ability. If it's something that's supposed to be common, any worthwhile software developer should be able to come up with it. If you were asked to implement binary search, it's not a matter of having the algorithm memorized, but rather that you should be able to easily reproduce the code just by knowing the concepts.

It's like asking someone to write FizzBuzz. Just because they can come up with the code doesn't make them a good software developer, but if they can't come up with a solution at all, then they're probably awful at the sort of problem solving skills that software development requires.

Who actually writes sorting algorithm from scratch?

Nobody. But making you write a sorting algorithm from scratch shows that you understand the concepts, which is extremely important.

5

u/KagakuNinja Mar 01 '17

There are books such as Cracking the Code Interview that breakdown hundreds of sample code challenges into categories, and provide a flow chart for how to analyze a code challenge and quickly pick one of about 8 basic strategies for solving the problem.

In other words, it is a way to cram for whiteboard challenges. It is necessary to do this kind of cramming, because solving whiteboard problems in a way that will impress the typical interviewer is significantly different than how we write actual code on the job.

Crammers will review all the basic algorithms of sorting, searching, etc; as a result, they will perform better if you ask such a question. If you ask a "custom problem", then they will apply the flow chart and again, perform better.

2

u/D3gr33 Mar 01 '17

I've read Cracking the Coding Interview before, and it definitely helped me in interviews (including the interview for the job that I'm supposed to be doing right now). The way that it helped me prepare for interviews, though, was by making me a better developer.

Knowing how to solve algorithmic questions makes you a better software engineer. Being able to clearly explain algorithm design by drawing things on a whiteboard is a crucial skill to being able to work with other developers. And being able to explain what you did in code and why is absolutely an important skill for anybody that works on a team.

A lot of companies definitely put too much stock into whiteboard and algorithmic problems. And a lot of companies do it completely wrong where they make it about rote memorization of specific algorithms. But if I were hiring developers, I would definitely pick the guy that can explain an algorithm on a whiteboard and answer questions about it over the guy that stands there muttering 'um' because he can't explain how he would approach an algorithmic problem.

2

u/thedufer Mar 01 '17

If you ask a "custom problem", then they will apply the flow chart and again, perform better.

So your problem with it is that people who studied and got better at the job I want them to do will outperform people who don't? I...don't see why that's bad.

2

u/beginner_ Mar 02 '17

t's like asking someone to write FizzBuzz

Not really. Because AFAIK they explain to you what the code should do and you just write it which is trivial. Requires 0 knowledge. If they say write bubble sort, then you need to know the algorithm/concept and apply it from there. Maybe we can argue:

"Write any sort algorithm, performance /big O doesn't matter."

Would be much more acceptable.

2

u/D3gr33 Mar 02 '17

Because AFAIK they explain to you what the code should do and you just write it which is trivial. Requires 0 knowledge.

You'd be surprised how many people get stumped by FizzBuzz. It works as an easy litmus test to see if someone actually knows any programming or if they're just trying to con their way into a cushy job. People in interviews for six figure salary software jobs still get asked FizzBuzz, and for good reason. Not disagreeing with you here, just adding to the discussion.

If they say write bubble sort, then you need to know the algorithm/concept and apply it from there.

To me, a big part of this is the conversation. If someone were to reply to the bubblesort question "I'm sorry, but I don't know bubblesort at all, could you maybe describe the algorithm and I can try to write it in pseudocode?", then that would still be a correct answer. I'm more interested in how they respond to the problem than whether or not they actually know the algorithm by heart. The only wrong answer is "I can't do that" without asking for help first.

Asking them to write any sort algorithm at all would also be a good question, though. A good candidate should be able to name half a dozen sort algorithms and describe which ones are good and why, which would definitely end up being part of that conversation.

2

u/rabidstoat Mar 01 '17

First job out of school in the early 90s asked me to code a sort in C, which I had indicated was a language I knew. I asked if there were any requirements in terms of efficiency, and they said no, no need to write something like a quicksort.

I wrote what I called Random Sort. It went into a loop that simply put the numbers in a random order. Then it checked to see if they happened to be sorted. If it was, the loop terminated and gave that as the answer. If not, the loop continued with another random ordering.

The input size was like 100 numbers and of course it didn't terminate. I argued that it met the requirements and would, indeed, produce a correct solution eventually.

I got the job.

Now granted, this probably only worked because I interviewed with someone I'd known for a few years as an undergrad research assistant, and who knew I was a good programmer. But still, it amused me at the time.

2

u/cockmongler Mar 01 '17

It worked because it demonstrated you could actually code. I have interviewed many people for coding jobs who couldn't code.

2

u/izuriel Mar 01 '17

It's called a Bogosort. As another user said, you demonstrated your ability to write code, and to were able to reason and defend your implementation. If you were trying to convince me (as an interviewer) this was a good algorithm for sorting, that would be the only thing that would make me not consider you.

1

u/HelperBot_ Mar 01 '17

Non-Mobile link: https://en.wikipedia.org/wiki/Bogosort


HelperBot v1.1 /r/HelperBot_ I am a bot. Please message /u/swim1929 with any feedback and/or hate. Counter: 38126

1

u/rabidstoat Mar 01 '17

Yeah, I never claimed it was good. I claimed it met the (weak) specification which said efficiency was not an issue.

I did offer to write a select sort if they wanted.

1

u/cockmongler Mar 01 '17

Bubble sort and merge sort are the kinds of things you should be able to do in your sleep.

2

u/beginner_ Mar 02 '17

Bubble sort and merge sort are the kinds of things you should be able to do in your sleep.

Explain why? I've hardly ever needed to sort outside the database and let alone any amount of data were the algorithm matters (eg. difference is user-perceptible. So using your standard libraries sort function is good-enough.

Do I also need to get the inner workings of a database? Where does it stop? Where is the barrier a programmer should not need to know anymore?

1

u/cockmongler Mar 02 '17

If you're using a database you should totally know its inner workings. That's like asking if a car mechanic should know the inner workings of a car.

2

u/beginner_ Mar 02 '17

Not at all. The mechanic has to fix the car so he needs to understand it. The programmer in my scenario is merely a user of the database so like the driver/owner of the car. Does knowing how to fix a car make you a better driver?

1

u/cockmongler Mar 02 '17

Knowing how the clutch works, the relationship between torque, power and rpm in the engine, the way tyres interact with the road surface to produce grip - and how that is affected by water, gravel etc..., how the brakes work and how they're affected by the environment - all of these things will make a you a better driver and they are all factors of how a car works. If you, as a driver, know how a car is fixed you are much less likely to be fleeced by car salesmen, mechanics and insurance companies.

For fucks sake people, developers get paid a lot of money, learn to do your damn jobs.

1

u/dgermain Mar 01 '17

While not asking to write sorting algorithm by hand, I would certainly consider fair to ask if they are aware of different ways to sort a list.

I would also ask if they think all sorting algorithm are equals, and if not, why someone may need different sorting algorithm.

But writing bubble sort is simple enough, I would not ask that myself, but if I did, I would explain the algorithm to the person first. And I would let them write the program on the board from there, interacting with them as they go along.

You want to see if you can communicate with the person, and if they can write some basic code, which is after all the job they are interviewed for...