Why I hate coding challenges in the hiring process
Tags: career, watercooler, discuss
Published: 2020-02-11 18:15:01

# The concept

We need to ensure that people have the skills they claim to have. I get that and accept that.

But how relevant are these coding golf challenges really?

## The investment

After experiencing assessments ranging from 5 minute multiple choice quizzes to 2.5 hour coding interviews, it seems to me that the commitment expected from a candidate keeps growing and growing.
And we should think about that for a second: 

Is it really okay to ask a job-seeker to invest half an hour for a phone interview, 2.5 hours for a coding challenge, 1 hour for psychological online tests, ignoring the additional hour the candidate presumably put into writing a cover letter and learning about the position/company?

Isn't there an underlying impertinence in saying: before I risk investing one single hour for a face-2-face interview, I expect you to risk investing about 15% of a work week? And never mind the fact that it could potentially be the candidate who decides not to go forward after finally seeing the company from the inside. I mean, somebody must have understood the psychological principle of reciprocity.

But I digress. Let's get back to the topic.

_EDIT:_ I was made aware in the comments (check it out if you are a thrill-seeker ;-) ) that the above paragraphs can be interpreted as "a candidate shouldn't be expected to show effort and invest time". As a clarification: I am referring to the trend of these procedures taking more and more untargeted time, and **don't** want to imply that a candidate shouldn't expect a vetting process (see [The concept](#the-concept)).

## The conditions

So welcome to this online code editor you have never seen before after signing off that you will not use your beloved IDE. Why? Because apparently working in a familiar surrounding that you will actually be using on the job is not interesting to the employer. Otherwise you could "cheat" by utilizing code-completion, syntax warnings, testing and all the other tools that would normally help you to produce the outcome the employer expects. Test-driven development? No, that's boring. Hiding the existing tests and not informing you about the errors is obviously a way more realistic scenario. Well, there's always logging for such cases, right? Think again! With hackerrank, for example, I haven't found any method of getting anything logged unless I run all test scenarios, losing valuable time as their system compiles my code each time (JS, mind you). 

## The time

So yes, these tests are timed. Nearly always. That alone wouldn't be an issue, but it does influence the way you are writing code. You want to get done, so variable naming is something you don't care about and your functions are all of a sudden 30 lines minimum. And different files aren't a thing anyway, right? The result is really ugly code. Code that works, but code you would reject in any real life scenario. Also, code that isn't necessarily performant. 
But worry not! Remember these tests you can't look at? Well, some of them test for execution time or memory and will give you feedback like: "Your code didn't return in the allowed time-frame". Ah, silly you! You though you are going to save a couple of minutes but instead will now spend additional minutes refactoring the code until the test is happy, without knowing what performance you have to target nor any kind of benchmarks at your disposal. Stressed yet, are we?

## The challenges

> Given an array of integers, your functions should return the sum of the indexes of the array elements that make up the sum of the two previous and two following array elements of the array element with the value of that sum.

Ready? Go! I kid you not. This is how your challenges are often formulated. Besides the fact that you will end up reading these tasks many times over and question your English comprehension skills along the way, it is absolutely beyond me how such scenarios are intended to be realistic in any kind of real-life scenario. 

"They are not supposed to be. They are intended to show your problem solving skills", you say? Congratulations, that is what those tests claim. But let's think about that for a second: A good developer doesn't jump into these kind of things like that. The important question for such a task would be "Hold on, what are you trying to achieve?"

I cannot emphasize this enough! A good developer understands the requirements and helps the customer or manager finding a solution. That is problem solving: **How to best achieve the actual need**. Given the challenge from above, one would have to ask: "I see. What do you need the sum for? What do these indexes represent and how does the array come about?" 

## The tragedy 

Have you been advised to train on Leetcode & similar? So have many. And while these systems are fun and do enhance your skills, I question how relevant performance in such scenarios is. I go as far as to say: not only does good performance in these challenges say little about your potential as developer (other than it indeed proofs knowing the targeted programming languages), it already produced candidates that are specifically trained for such unrealistic scenarios only. In the end, I have no use for people who can write functions that "remove the smallest array element(s) until the array is empty" or "bubble sort all characters of the alphabet until the concatination includes 'hamburger'". Not if these candidates fail to write something as common as a secure login component or sending out a notification email on form submission. Where are we going with this?