Hacker News new | ask | show | jobs
by clipradiowallet 1743 days ago
A tale of 2 technical interviews..

Interviewer: There is a file of 500,000 words. Some of the words are duplicated. I would like you to produce a report of the duplicated words, and the report should be sorted most-duplicated to least-duplicated. You can use any programming language you like.

Candidate 1 spent half an hour writing a program in Java that accomplished the task. He passed, but was ultimately not offered a job.

Candidate 2 spent approximately 10 seconds and typed `cat words.txt | sort | uniq -c | sort -gr`. He passed, and was hired.

The moral is...sometimes a technical task in an interview is not to assess only your coding ability, it's also to assess your problem solving methodology. The person who used common user-space unix/linux tools didn't already have his mind locked into "writing a program to accomplish the interviewer's objectives" - he just used the lowest common denominator(the shell) that could accomplish the task he was given. It's not all algorithm memorization that counts.

7 comments

This is classic "your answer is not my answer." And it's a form of bias. You passed on the person who knew how to write a more complex solution to the problem, and chose the person who chose a more simplistic route. But there's zero commentary on whether Candidate 2 had the knowledge required to write the complex program to solve the problem. Whereas Candidate 1 could have (likely) been easily taught what the command line alternative was.

Your process seems flawed as it appears to operate solely on your bias, from this description.

I've brought up easy solutions like this. The response is almost always "Well don't do that. You can't use that." I legitimately think it's because they don't understand that actual solution and are embarrassed about being shown up.

In the 1 or 2 cases where they just want to see you do it in X language, it always turns out so wildly inefficient. I don't understand what you're supposed to do.

"Don't use that 1 line textbook optimal solution. Use a for loop instead." Uhh.. Ok. I guess they want to see more lines of code? More code = more better engineer.

"Why are you using a double for loop? Why didn't you just use the built in method to solve this?"

Sometimes the "built in method" is literally the original solution you were presented, but slower. What are you supposed to do? If you can't use the optimal solution, why are they giving feedback on suboptimal code in a follow up answer?

It's like they're asking you to demolish a building, but you can't use TNT or heavy construction equipment. So you pick up a sledgehammer and talk about the weak points in the structure and how you have to have a plan and strategically knock down support beams to demonstrate your knowledge in this theoretical situation. But they just scream at you-- why would you use a sledgehammer instead of a wrecking ball?

"Wrecking ball isn't heavy equipment! It's built into.... A machine. Totally different."

Or why aren't you using a rocket launcher? I guess you're inexperienced. "Rocket launcher is totally different from TNT, of course! You didn't even think to use that! I guess you're not a real engineer, huh?"

I mean if someone limits you from using TNT when that's clearly the solution, using a rocket launcher should clearly not be in the spirit of the challenge they presented.

Isn't this also a case of just... having bash skills? I feel like your two cases are just programmers that have different toolboxes under their belts -- the second candidate does not necessarily demonstrate more problem-solving skills than the first.
That's.... a really poor comparison, maybe you missed some background on what exactly the interviewer was looking for. Sure, maybe CLI knowledge is going to be useful, but if you're looking for experience with Java because you're going to implement some complex string filtering in it, then the 2nd candidate's solution is literally useless as a comparison point. Also, if you're comparing them directly you're essentially punishing the 1st developer for maybe not having experience with some technology that was particularly well suited for that question.

Would you also have accepted a solution like "I send the file to someone on Mechanical Turk to find the words"? Or "I ask my daughter to look through them and find them"? Or "I ask someone in an interview to write a program to find it out"? Or "I paste it into this online tool that produces statistics of the most common words in some text"?

I see some other folks chimed in here too, but I wanted to add my 2ยข.

I see the appeal you are outlining, but I can't help but feel like the demonstrated solution is really just programming under a different moniker, but one that doesn't align with the spirit of the posed question. Is bash a programming language? I guess so.

I've been programming professionally for 7 years. I know `cat`. I don't know those other things off the top of my head.

I could implement a solution much like the Java candidate though, with information that I have memorized through years of constant use.

Being clever and novel is a cool party trick, but ultimately only proves that you are clever and have novel ideas. That could be great for an organization, but it might also be the wrong fit for whatever role is being considered.

Your final sentence highlights a bit of hypocrisy (no judgement!)

> It's not all algorithm memorization that counts.

But that's _literally_ what the bash solution was. Memorization of an algorithm, albeit a very optimized one!

I don't agree with this.

>The person who used common user-space unix/linux tools didn't already have his mind locked into "writing a program to accomplish the interviewer's objectives"

It's partly your fail as a interviewer that candidate has to guess what you expect from him.

What if instead of using bash s/he had used popular GUI tool like Excel(let's assume that it performs the job quickly too), then would it be OK too?

you are literally measuring a person on their familiarity with a tool and not general problem solving aptitude, people with high problem solving aptitude can learn tools needed for a job pretty fast.