Ayende @ Rahien

It's a girl

Stories from the interview room, part II

So, I just finished interviewing a candidate. His CV states that he has been working professionally for about 6 years or so. The initial interview was pretty well, and the candidate was able to talk well about his past experience. I tend to do a generic “who are you?” section, then give them a couple of questions to solve in front of Visual Studio, an architecture question and then a set of technical questions that test how much the candidate knows.

Mostly, I am looking to get an impression about the candidate, since that is all I usually have a chance to do in the span of the interview. The following is a section from the code exercise that this candidate has completed:

for (int i = 0; i < sortedArrLst.Count; i++)
{
    if (sortedArrLst[i].Contains(escapeSrt[0]))
    {
        if (sortedArrLst[i].IndexOf(escapeSrt[0]) == 0)
        {
            sortedArrLst[i] = sortedArrLst[i].Remove(0, escapeSrt[0].Length+1);
            escapeStrDic.Add(sortedArrLst[i], escapeSrt[0]);
        }
        
    }
    if (sortedArrLst[i].Contains(escapeSrt[1]))
    {
        if (sortedArrLst[i].IndexOf(escapeSrt[1]) == 0)
        {
            sortedArrLst[i] = sortedArrLst[i].Remove(0, escapeSrt[1].Length+1);
            escapeStrDic.Add(sortedArrLst[i], escapeSrt[1]);
        }
    }
}

Thank you, failure to use loops will get your disqualified from working at us.

Then there were the gems such as “mutex is a kind of state machine” and “binary search trees are about recursion” or the “I’ll use perfmon to solve a high CPU usage problem in production”.

Then again, the next candidate after that was quite good. Only 4 – 6 to go now.

Comments

Rob Conery
07/29/2013 09:26 AM by
Rob Conery

I trained a real estate appraiser how to edit videos. His favorites? Yours. He made the compilation for our Mystery Code Theater. He's amazing and knew shite 0 nil about video editing.

Your evaluation process is filtering the Brilliant Mind.

Ayende Rahien
07/29/2013 10:11 AM by
Ayende Rahien

Rob, Can you translate this so I'll be able to follow?

Steve Conlan
07/29/2013 10:18 AM by
Steve Conlan

@Ayende What can't you follow about @Rob's post? What can't you translate?

I'll explain for you, Rob is suggesting that a mind capable of learning and getting things done is being filtered out of your process.

Rob Conery
07/29/2013 10:19 AM by
Rob Conery

Sure :). Editor Scotty (the guy that does the rough edits on our vids - including yours) was a real estate appraiser and (is) a very smart, capable person. He didn't know how to use video editing software so I showed him - as well as the things I look for in terms of story line and so on.

Not only did he learn how to effectively "rough edit" - he also learned how to fast-cut and squeeze a story out of long-running video clips. This kind of thing is utterly priceless to me.

He got it because he's bright and motivated and understands what I want him to do.

My point: you're ignoring so much by staring at a simple data point: "does this person know for loops?". I understand that you expect your hire to know to use them, but that's a 10 second conversation to someone who might not know at this very moment.

Subject matter (in my experience) matters very little. Desire, excitement, personal skills and a willingness to learn and help - way way way more important. To me, these are criteria number 1.

Ayende Rahien
07/29/2013 10:22 AM by
Ayende Rahien

Rob,

The major difference is that this someone came with 7 years of working with code. By this time, if he didn't get the hang of using loops, he probably won't be.

nbevans
07/29/2013 10:55 AM by
nbevans

Sorry Rob but I'm with with Ayende on this one. Way too many "smells" with that candidate's answers; the risk of a bad hire is too high to consider him further.

Justin Nel
07/29/2013 10:57 AM by
Justin Nel

Ayene,

Have you thought that perhaps he was never told he was doing it wrong, so never had a reason to question his methods, and as such never improved. From personal experience, once upon a time I thought I knew threading simply because I knew how to create a thread and make use of delegates. A couple years later I discovered how wrong I was and quite quickly started to improve on what I knew about threading as to write better code going forward (and improve things I had written in the past).

Justin Nel
07/29/2013 10:59 AM by
Justin Nel

Really need the ability to edit comments on here... My apologies for the typo with your name!

Jef Claes
07/29/2013 11:08 AM by
Jef Claes

But the tests pass right?!

Bob
07/29/2013 11:09 AM by
Bob

What exactly are the loops problems in the candidate code?

Dorin
07/29/2013 11:19 AM by
Dorin

Interesting. maybe working under pressure is not his best.:)

Ayende, did you ask him to refactor his code? because everybody does it , the refactor thing.

Christophe
07/29/2013 11:19 AM by
Christophe

The current loop contains the same code twice. The only difference is that he's first checking the first item, then the second. He should have looped over escapeSrt at least.

Kelly Sommers
07/29/2013 01:17 PM by
Kelly Sommers

As an employer, I don't think posts like this are a professional way to behave. Although they are anonymous, there is a human trying to make a living being humiliated here and I can only imagine how they might feel after having a bad interview only to then read it up on the internet in the public eye.

Posts like this series make me uncomfortable because I've been that nervous person interviewing for a job. I've said some pretty ridiculous stuff during these moments.

Attracting good talent is like marketing. Blog posts like this don't help project a friendly work environment, even if its the furthest from the truth. I don't think I would interview with any workplace that humiliates candidates this way.

If you're trying to attract good talent, this isn't helping.

PR
07/29/2013 01:19 PM by
PR

Ouch! That is scary code. I am worried for that guy.

Daniel Lidström
07/29/2013 01:30 PM by
Daniel Lidström

He's modifying the string he's iterating. I'd say that is a no-no.

Patrick Smacchia
07/29/2013 01:42 PM by
Patrick Smacchia

I am with Kelly here, "there is a human trying to make a living being humiliated here and I can only imagine how they might feel after having a bad interview only to then read it up on the internet in the public eye."

You'd better mention only positive things that happen in the interview room, such positive things that made your mind to actually hire the guy.

peter
07/29/2013 02:21 PM by
peter

Oren's interview rant posts are not western-PC, and nor are his code reviews. It has already been pointed out that in some cultures there are different ideas on what is PC, and the interviewees, coming from the same background, are probably not as broken up about his outspoken opinion as you think they should be. Also Oren is a bit of a dafka-nik, so complaining will probably not help. I actually like these entries every now and then.

Eric Smith
07/29/2013 02:34 PM by
Eric Smith

I agree with Kelly as well. I really don't see the point of these posts other than to humiliate the person that was interviewed. What purpose do they serve?

Dan
07/29/2013 02:37 PM by
Dan

I'd chalk up the issues with that code due to nervousness/pressure... but not after seeing the way they described binary trees and mutexes... also, I'm curious, Ayende, what would you consider a good answer for high CPU issues in production? Analyzing dump files?

Dan
07/29/2013 02:45 PM by
Dan

Another thing - I LOVE the fact that you let interviewees use Google search when writing code. That is something I will push to adopt at my company. I think that's a fantastic way to simulate their real world abilities.

Erick
07/29/2013 03:02 PM by
Erick

Perfmon is a perfectly legitimate tool for analyzing high CPU usage. There are all sorts of things you can use it for to help narrow down where your CPU usage is coming from. Occasionally this is even enough to make the root cause obvious. In other cases, it often can help you find a good starting point.

Ayende Rahien
07/29/2013 03:32 PM by
Ayende Rahien

Justin, I am assuming that "you can use a loop for that" is basic enough that it came up before. Again, we are talking about someone with 7 years of coding experience.

Ayende Rahien
07/29/2013 03:38 PM by
Ayende Rahien

Dan, High CPU? Look using something like Sys Internals tools to look at the threads of the running system, to see stacks. Taking mini dumps and analyzing it.

Justin Nel
07/29/2013 03:38 PM by
Justin Nel

Ayende, I fully agree with you in this instance. I am just hoping that you do not use this mindset as a blanket across all bad code. At the end of the day, we've all made mistakes, and unless we have a reason to question what we know (such as criticism, comments, etc from our peers), then we will not learn and will simply continue to repeat our mistakes.

wqw
07/29/2013 03:56 PM by
wqw

Why is everybody so politically correct? Is this code BS or not?

Scary...

JV
07/29/2013 04:05 PM by
JV

At my previous job, the CIO wanted to hire a ".NET Enterprise Architect". So he brought forth a previous employee, from his last company, who claimed such a title, with 10 years of experience.

(First warning sign: CSLA was plastered all over his resume).

When he came in, I handed him our Junior .NET Developer quiz (ten questions of really basic crap).

One of the questions was: "How would you convert this comma delimited string into a string array?" (it also included a code sample of the string value to use)

His answer (after almost 2 hours): "I'll get back to you." (literally written as the answer)

That night, he got home and emailed me about String.Split.

We didn't hire him.

Phew.

I can understand Oren's frustrations.

RichardG
07/29/2013 07:12 PM by
RichardG

I see being politically incorrect as saying "this person is a bad coder because they are... choose gender/race/sexual orientation/..".

Saying they're a bad coder because they write crap code is being honest and professional (although a little blunt).

Having seen several recent samples myself of code from prospective employees, who, despite having multiple years C# experience, are completely unable to write and use a class with 2 properties (string and int) and 2 methods (to increment the int and reset it to zero).

So "Ten years experience or one years experience ten times"?

Judah Gabriel Himango
07/30/2013 03:23 AM by
Judah Gabriel Himango

Seeing all these comments sympathizing with the interviewee, I wrote up a blog post on all this:

Charlatan developers and the blunt truth http://debuggerdotbreak.wordpress.com/2013/07/29/charlatan-developers-and-the-blunt-truth/

ENOTTY
07/30/2013 03:24 AM by
ENOTTY

Not looping escapeSrt[] is bad and an immediately obvious oversight, but what about (assuming the logic is correct) the possible double exhaustive search of sortedArrLst[i] via Contains() and IndexOf() if you're only ever going to remove it when the string StartsWith() escapeSrt[j]?

Tom Janssens
07/30/2013 10:40 AM by
Tom Janssens

Join the club! I once interviewed a guy who had 4 years of experience with Oracle, however he did not seem to know what a GROUP BY was.

Brian Brashear
07/30/2013 01:35 PM by
Brian Brashear

It's all about the approach Ayende chose to take. He could have taken the individual to the side and used the opportunity to mentor, but instead, Ayende has chosen to take the cheap, unprofessional route for a quick laugh at the interviewee's expense. Yes, the interviewee should have been informed, but not via a blog entry having the sole purpose of embarrassment. I really don't even take issue with exposing this via a blog entry had Ayende acted more as a teacher, using the opportunity to show what he felt was the correct answer and explaining why he felt so. But Ayende's criticism was not constructive... it was 100% destructive and honestly it is that type of attitude that I would avoid hiring at my company. If we are truly being critical for the sake of comedy, why not point out Ayende's numerous grammatical mistakes in this article and many others. We can all laugh at his misspellings and other mistakes, right? No, because I'd like to think we're better than this, though, I have a feeling I'll be proven wrong.

Judah Gabriel Himango
07/30/2013 03:08 PM by
Judah Gabriel Himango

Mentor? He's interviewing people for a job, not grooming protégé.

Daniel Marbach
07/30/2013 07:57 PM by
Daniel Marbach

You should look for engineers which are not good in programming but have strong social skills. This would certainly help HibernatingRhinos to build up some karma. Technical skills alone are not useful. With that People might get less answers like:

What has been done in terms of performance for RavenDB?

200%

I think there is a problem with RavenDB Performance... Could that be?

No! Provide failing test!

Just my two cents

Jiggaboo
08/05/2013 01:08 PM by
Jiggaboo

What's exactly the problem in this code (with loops)? I see useless if Contains and could also probably write this with LINQ but other then that?

Jiggaboo
08/05/2013 02:11 PM by
Jiggaboo

And it also checks each line twice, doesn't foreach on escapeSrt. But we don't know what he was to write.

JohnyProgrammer
08/06/2013 08:05 AM by
JohnyProgrammer

What is wrong with this code? Or what should it do? Without knowing what it should do we can't point errors. Ok there are useless checks but can you explain what you had in mind talking about loops? I'm bad at spotting things without running them. So I copied it into VS. Compiles, works. Printed out both list and dictionary. But I don't know what this code should do.

Ayende Rahien
08/06/2013 08:08 AM by
Ayende Rahien

Johny, If you don't see the problem, I really can't help you

JohnyProgrammer
08/06/2013 12:07 PM by
JohnyProgrammer

Ok, I suck. I get it. But can someone tell me what is wrong with this code?

JohnyProgrammer
08/06/2013 07:17 PM by
JohnyProgrammer
  1. Code duplication (could be extracted to method)
  2. Removing escape string removes it and one additional character
  3. If there are two input strings one starting with first escape string and another starting with second escape string and then they have same rest of the string adding it to dictionary will throw - input: "acde", "bcde", escapeStrings: "a", "b"
  4. Not iterating over escapeSrt (but we don't know if he wasn't said there will ever be only two elements in escapeSrt)
  5. If he's logic is right he could also join escape strings and do one check if StartsWith(joinedEscapedStrings).

What have I missed. Only point 4 touches loops. And as I said we don't know what info he got on table containing escape strings.

Guest
08/07/2013 05:19 PM by
Guest

Saying this gut can't use loops is really stupid. What is for? Isn't a loop? First you should tell readers what he was up to implement. Without that we can't judge him. I wonder how all the people can laugh at him? This code could have many bugs or not, be written how he was said to write it or not but we don't know that without knowing he's task!

Comments have been closed on this topic.