If you cannot reverse a string under pressure, you are likely unqualified for the job you are applying for. At least in my job, there is often more pressure than "write a string reverse function in any language you like in 10 minutes."
What a load of bollocks. If your job is to write methods to reverse strings then you are unqualified, otherwise I wouldn't give a shit whether a candidate can reverse a string. Why would I want to know if someone can reverse a string if the job is to maintain a web app?
A few questions for you. How old are you? Have you hired developers before? Truthfully, have you ever had to reverse a string under pressure at your current job.
Are you kidding? reversing a string in your language of choice is far too trivial. If you can't do it you really aren't ready to be working in the industry.
It's not about whether they can do it or not. It's about why knowing a skill that will take even a non-developer ten seconds to Google makes someone incapable of functioning as a developer.
More often than not the people that spout that kind of nonsense are twenty-something junior developers that read a bit of HN and have decided that they know better than everyone else about what makes a good programmer.
Why would you test if someone can reverse a string if you're hiring someone to maintain and build on some shitty web app?
It takes someone who doesn't speak English ten seconds to look up the past tense of the verb "bring" - this doesn't mean you'd want to hire as a journalist someone who seems to think the answer is "bringed"
Doing a string reverse is so trivial that it's not about needing that skill, but rather what not being able to do that speaks about the candidate's general aptitude and skill level.
"Why would you test if someone can reverse a string if you're hiring someone to maintain and build on some shitty web app?"
If that question can't be answered then your opinion on someones skill level is irrelevant. Also, if you've got time, answer the questions in my first post:
"How old are you? Have you hired developers before? Truthfully, have you ever had to reverse a string under pressure at your current job."
Because anyone who can't do this almost certainly doesn't have the ability to program any software system well, some shitty web app or otherwise. You're not trying to fill out a remedial CS course in community college, you're trying to get someone to program real things real people use.
The only way this question wouldn't be useful is if you had a good filter such that almost everyone who gets to that point would answer that question correctly. But apparently, this is not the case. There are people who fail such tests (despite apparently good paper qualifications and ability to talk BS). It's fairly important that you not let through such imposters.
And yes I've hired people and all of them have had to answer much more complex algorithmic questions to get the job and all of them turned out to be competent. And "have you ever had to" questions are ingenuous - interview settings are never going to be replicated exactly in a work setting, unless your job is to go around to be interviewed for different jobs. Good interview questions don't simulate work setting - they extract most critical work-relevant information about the candidate without wasting time.
"Because anyone who can't do this almost certainly doesn't have the ability to program any software system well, some shitty web app or otherwise. You're not trying to fill out a remedial CS course in community college, you're trying to get someone to program real things real people use."
So...I'm hiring someone that can reverse a string because this demonstrates that they can program real things that real people use?
"And yes I've hired people and all of them have had to answer much more complex algorithmic questions to get the job and all of them turned out to be competent."
Out of interest, what did this job entail? I assume that you quizzed them on their knowledge of basic algorithms because they are required to write them, right?
String reversal, and all the other common interview questions are simply a microcosm of what a developer does day to day. Programming is about comprehending abstractions and composing them into a greater whole that solves a specified business problem. Reversing a string is exercising those same mental faculties. There is literally no difference between working out the steps to reversing a string and working out the steps to pulling data from a database, transforming it, and displaying it on the screen, except that for the second example one can Google then copy/paste about 90% of it. Asking "reverse a string" type questions will weed out the Google-jockies (obviously there's nothing wrong with Googling for an answer, but if you have to Google for everything you're in the wrong line of work).
Bullshit. The only reason why people ask these things is because big software houses do so, and for some reason they think that their shitty web app needs a Google quality "rockstar developer".
The difference between reversing a string and pulling data from a database are, literally, completely different tasks. The killer is that the latter is something that a candidate will do in a job.
You're more than welcome to ask those questions, and you're probably likely to weed out the lowest common denominator types. In my experience, they're a waste of time and the best possible interview you can give to a developer is a frank face-to-face discussion about programming, and then getting them to work on a test project for two hours from your own code base. If they can do that much they can program.
>The difference between reversing a string and pulling data from a database are, literally, completely different tasks. The killer is that the latter is something that a candidate will do in a job.
And this is where you misunderstand the purpose of these types of questions. Programming is a very dynamic field where you're likely be required to solve novel problems daily (not novel in the grand scheme of programming, but novel to you). You need the mental flexibility and fluidity to solve problems you haven't entirely encountered before. Testing specifically what you do at the job is the wrong approach. You need to test the required mental faculties to solve novel problems. Programming is not pulling data from a database, writing glue code, and shoving it to the screen. It's solving new problems every day.
> The difference between reversing a string and pulling data from a database are, literally, completely different tasks. The killer is that the latter is something that a candidate will do in a job.
Why can't you do both? Seriously? Pulling data from a database is orders of magnitude harder to get right than reversing a string.
That's not the point. You have a finite amount of time in an interview, so why on earth would you ask a question regarding a meaningless skill that the candidate will use maybe once in their entire time at the company when you can ask something that, you know, might actually tell you if they're a good programmer or not.
Being able to recognise the correct answer in the sea of dross that is search engine results pages is better.
Being able to take the correct answer, and adapt it to what you need, and plugging it into what you already have, is best.
Do you really want to employ people who say they have X years of experience doing something but who cannot do a very simple task in the choice of their language? That's not a stupid trick gimmick question - there's no "gotcha" there. Perhaps we're getting caught up on the specific "reverse a string". Substitute that for something relevant to maintaining and building on a shitty web app.
Out of curiosity, when the interviewer asks you to reverse a string in your language, say Ruby, are you supposed to use existing algorithms/methods built-in in that language, or to flip each character using a for-loop? In Ruby, it's really a single method called reverse will do the trick, i.e., "hello".reverse gives "olleh". I'm trying to make sense of the reason why such a question is asked.
No, the expectation is that you'll use a loop or recursion. If you use an existing method/function, the interviewer will kindly ask you to implement that yourself.
The general reason why such a question is asked is because interviewers don't have an infinite amount of time and there's no point in considering any candidate who can't do this. It's a way to weed out ridiculously bad candidates so that you can focus more on good candidates.
Explain. If you can't produce a god damned string reversal function in 10 minutes, why would I believe you can produce a bug fix to your own, complex code in a few hours? That's what interviewers are considering: the interview is a proxy to see if you can come close to the requirements of the job.
I can program a string reversal with my eyes closed, tied up in chains, upside-down, while holding my breath. Or whatever.
The point is more that for a person with a given skill level, interviews can be stressful and make them perform below that skill level. I try to structure my interviews such that people get more comfortable and I don't ram their head into a metaphorical wall. I get all the same information, but without all those hard feelings.
Can you get in the zone with people watching and judging you intently? If you can't get into the zone with only a couple of people watching you, how will you get into the zone when the whole company is depending on your bug fix?
The pressure of judgement is not the same as the work pressure of a stressful scenario. It's why public speaking and job interviews are among the most feared activities people go through, but people consider meetings boring and mundane.
Easy, the company that is depending on me is not physically there, watching and judging me. Sure they probably are watching and judging me, but as long they're not physically present that makes all the difference to my mind...