I find it difficult to believe, but the reports keep pouring in via Twitter and email: many candidates who show up for programming job interviews can't program. At all. Consider this recent email from Mike Lin:
The article Why Can't Programmers... Program? changed the way I did interviews. I used to lead off by building rapport. That proved to be too time-consuming when, as you mentioned, the vast majority of candidates were simply non-technical. So I started leading off with technical questions. First progressing from easy to hard questions. Then I noticed I identified the rejects faster if I went the other way – hard questions first – so long as the hard questions were still in the "if you don't know this then you can't work here" category. Most of my interviews still took about twenty minutes, because tough questions take some time to answer and evaluate. But it was a big improvement over the rapport-building method; and it could be done over the phone.After reading your article, I started doing code interviews over the phone, using web meetings. My interview times were down to about 15 minutes each to identify people who just can't code— the vast majority.
I wrote that article in 2007, and I am stunned, but not entirely surprised, to hear that three years later "the vast majority" of so-called programmers who apply for a programming job interview are unable to write the smallest of programs. To be clear, hard is a relative term -- we're not talking about complicated, Google-style graduate computer science interview problems. This is extremely simple stuff we're asking candidates to do. And they can't. It's the equivalent of attempting to hire a truck driver and finding out that 90 percent of the job applicants can't find the gas pedal or the gear shift.
I agree, it's insane. But it happens every day, and is (apparently) an epidemic hiring problem in our industry.
You have to get to the simple technical interview questions immediately to screen out the legions of non-programming programmers. Screening over the telephone is a wise choice, as I've noted before. But screening over the internet is even better, and arguably more natural for code.
I still wasn't super-happy with having to start up the web meeting and making these guys share their desktops with me. I searched for other suitable tools for doing short "pen-and-paper" style coding interviews over the web, but I couldn't find any. So I did what any self-respecting programmer would do. I wrote one.Man, was it worth it! I schedule my initial technical screenings with job applicants in 15-minute blocks. I'm usually done in 5-10 minutes, sadly. I schedule an actual interview with them if they can at least write simple a 10-line program. That doesn't happen often, but at least I don't have to waste a whole lot of time anymore.
Mike adds a disclaimer that his homegrown coding interview tool isn't meant to show off his coding prowess. He needed a tool, so he wrote one -- and thoughtfully shared it with us. There might well be others out there; what online tools do you use to screen programmers?
Three years later, I'm still wondering: why do people who can't write a simple program even entertain the idea they can get jobs as working programmers? Clearly, some of them must be succeeding. Which means our industry-wide interviewing standards for programmers are woefully inadequate, and that's a disgrace. It's degrading to every working programmer.
At least bad programmers can be educated; non-programming programmers are not only hopeless but also cheapen the careers of everyone around them. They must be eradicated, starting with simple technical programming tests that should be a part of every programmer interview.
Nowadays many people comes to programming world with the buzzwords like "MVC", "Patterns", "Sharding", "Highavailability", "Highscalability"...
But many people don't know how to write simplest programs, such as "how to find the smallest common multiple of two integers".
It's sad.
That article makes me feel good.
As an incompetent programmer myself (I am a build engineer and good enough at that), I find it reassuring to learn that the vast majority of wannabe programmers fail at tasks that even I find easy.
(Regarding the FizzBuzz problem, I think the problem is even easier because the two words are meant to appear in the same line.)
Looks like I could learn more but I do find myself in a decent starting position.
Inspired by Jeff's FizzBuzz I conducted several technical interviews in January and February 2009 for the company that I was working then.
I was shocked to see how true it was. Several 4+ years programmers struggled slowly to do it and many of them got stuck and called for my help.
The funniest of them all was a woman (don't get me wrong but... thing are the way they are) who couldn't find the modulo result and wrote a small function which iteratively subtracted one operand from the other until it hit zero or a negative value and took the decision from there on.
When I showed her the % operator she was shocked how simple and elegant that was..
It's a market full of incompetents. Sadly.
Andreir.wordpress.com on February 22, 2010 3:33 AMInternet interviews are a great screening method. With a combination of Skype and Google Docs, you can do it for free, from anywhere in the world.
What does Mike's app do that can't be done with Google Docs?
I keep reading posts and blog entries related to this topic and it frustrates me. I have been working in IT for many years and recently completed a new degree focused around Information Systems and programming as I want to move from IT into development.
I find that most of the job postings without the Senior keyword in their title are looking for people with 5-7 years of programming specific experience and many of the senior positions have phrases like "Javascript, CSS, jQuery would be a plus" which I have but I am certainly no Senior Programmer.
I have used Perl and VB in my past life as an IT worker for 10 years and after learning C/C++, C# and ASP.NET I feel like a total noob. Until I finally get a job firmly in the software development role where 0% of my time is spent managing systems I feel like I am a very junior programmer.
I quess my biggest problem in looking for a position is how much of my IT scripting experience to I count toward actual programming experience and where are people drawing the line with the use of "Senior"?
Great I can write all the simple apps people talk about using as interview questions but I can't get a call for the interview as I have 10+ years of non-programming specific IT experience.
Jason Real on February 22, 2010 3:33 AMAt least in Sweden, people who are "on the dole" have to apply for any job they can, even if they haven't got a snowball's chance in hell to actually get it. If they don't, they lose their unemployment benefits. That might have something to do with it, at least here
Jobjorn on February 22, 2010 3:40 AMI haven't really used it, but you might want to have a look at http://codility.com/. It's an online programming assessment test that can actually evaluate the correctness of the answer automatically (a series of unit and perf tests).
Mdrozdo on February 22, 2010 3:45 AM"Why do people who can't write a simple program even entertain the idea they can get jobs as working programmers?"
This is why: http://en.wikipedia.org/wiki/Dunning–Kruger_effect
Also, for the unemployed, the cost of interviewing is very low compared to the potential payout, so even if they think it's a long shot they might still try.
Omer, are you seriously suggesting that one can effectively write code in what is essentially MS Word? *brows furrow*
Levi Neely on February 22, 2010 3:49 AMI couldn't agree more with the conclusion that NPP's (non-programming programmers) should be eradicated. Lately I've been, jokingly but with a very serious undertone been saying there should be a world wide register for these individuals so they can't ever work in that field again, for the protection of everyone who values the work they do.
Lately I've been working on a project that involves an API that's clearly written by NPP types and the entire API is a complete example with 100% coverage of what *not to do* in .NET. It's a total inverse of every best-practice as if there was a contest to see how bad one could screw up an API.
Needless to say, once the multitude of problems came up, try to communicate and explain the problem when the other side you're dealing with consists of NPP types. And then you provide them with profiler output that clearly identifies some very major problems, you point out exactly where, and even explain *how* to fix it with a few lines of code and you don't get anywhere with them because they just don't seem to understand *anything* at all.
It certainly made me wonder how people like that got their jobs doing what they're (clearly NOT!) doing. Your post highlights, once again, one of the very serious gravitational black holes in the industry.
I also had interviews with people that have written in there CV 5 or more years of coding experience. But they couldn't really tell me the difference between an array and a simple object. I should also start with internet interviews.
One line I love in CV's is the following:
Java/JavaScript -> Excellent
Nicolas Ruflin on February 22, 2010 3:53 AMDuring a round of recruiting at my last job at a tech startup in London I got to experience first hand just how terrible most applicants are.
I interviewed a load of candidates who all claimed 5years + industry experience so I was expecting great things. Unfortunately my incredibly taxing interview question proved too much for them all ...
"In any language you like (with no attention paid to getting every last semi-colon in the right place) write a function that reverses a string."
By the afternoon adding -
"Do not cheat and call your languages' equivalent of str_reverse."
No one managed it and I learned why I needed to phone screen people from then on. :(
I like to start things off by handing them a short piece of moderately crappy code and having them critique it. You get a good idea of how they think. We also kicked around the idea of showing them a function and having them write a unit test for it, or vice-versa. Never actually tried that though.
And google docs would be a fine tool for the job. Wouldn't want to use it for day-to-day coding of course, but it should work OK for an interview.
Bruce Keeler on February 22, 2010 4:04 AMThis tool is a basic version of Etherpad. With Etherpad multiple users can write (you can help the interviewee).
Thomas Jung on February 22, 2010 4:05 AMThis is rather amusing timing, as just this Friday my colleague was telling me about a friend of his that had applied for a job required 2-3 years experience in PHP/MySQL/HTML/CSS/JavaScript, with strong leaning on OO and MVC patterns, and agile/XP development.
The friend had taken a web/programming course at college 3 years ago, but not a lot since. He'd never even heard of MySQLi or objects.
The thing is - a lot of these guys get through because the first filter on resumes is a human-resources drone who can match up the words written in a resume (tailored to a job description) with the job description. Also, a lot of them get accepted into jobs because the person interviewing them is not a programmer - you'd be be surprised at how many managers don't bring in one of their experienced programmers into the conversation.
And then these guys sit there for a couple of years - hammering out godawfully buggy and insecure code - and then they can move on and now they have 'legitimate' job experience they can use to win the next job.
I like the link to Dunning-Kruger effect - and I'm sure that many people reading these comments will nod to it. But added to that is the general perception that programming is easy (we all hear stories from clients that balk at a fee just because "their 16-year old nephew can do it for nothing") because it is just drag and drop (isn't it?), and typing a little (surely?) - this is like thinking that just because you can cement some bricks together into a barbecue that you can engineer the building of a 20 storey building. We need to make programming look as difficult as building a skyscraper - and we should work to make 'software developer' a protected profession like 'architect' or 'medical doctor'.
Only allowing state certificated software developer's to apply for a position should cut down on wasted interview time.
Stuart Jones on February 22, 2010 4:11 AMDunning-Kruger effect
That explains why incompetent people are less likely to realise their incompetence, but it doesn't explain why people who studied programming to some extend find themselves unable to write simple programs.
As I said before I am not the most competent programmer, but I can write simple programs like the ones linked to in the article and I also program simple things at home just for the heck of it (I have a Haskell program to calculate which pizza is cheapest etc.).
Perhaps the problem is that programming courses tend to teach APIs rather than basic programming?
One thing to watch out for is to not stray too far into academic ground. The first comment said "many people don't know how to write simplest programs, such as "how to find the smallest common multiple of two integers"."
I have been programming for over 10+ years and I have never needed to find the smallest common multiple of two integers....ever. I have also never needed to read or understand hex, so I would not expect anyone to know or care what comes after F. I'm positive there are a lot of great programmers who may not know these answers off the top of their heads because they are actually rather obscure (unless you were a math major maybe).
Still, some things are truly universal the FizzBuzz test is pretty good. Some simple SQL is probably a good test also. I once had a Sr. developer who was just hired turn to me and ask "How do you do a 'outer' join?"
Ryan Bergman on February 22, 2010 4:38 AMIronically, I'm busy experiencing *exactly this*. I decided to formulate my own assessment that candidates come in to do.
I've blogged about this, and intend to collate the results once I've got a fair sample of assessment results:
http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/
http://thelimberlambda.com/2010/02/20/senior-developer-assessment-revisited/
So far, not great ... four candidates and not one could generate the first 30 terms of the Fibonacci sequence (detailed explanation of the formula as well as first five items were provided!).
ericwsmith.myopenid.com on February 22, 2010 4:40 AMWhen I was interviewed for my second programming job, I was asked to write a function that prints the nth Fibonacci number. I scratched it out on a piece of paper, and apparently that was so rare the interviewer suspected someone from the company had leaked the answer to me, knowing it was his stock question.
I used to ask the following question as my "hard" question. It showed up some years ago on the Boston Perl Mongers mailing list. People didn't have to produce working code, but it was helpful to see their thought process:
You have the numbers 123456789, in that order. Between each number, you must insert either nothing, a plus sign, or a multiplication sign, so that the resulting expression equals 2001. Write a program that prints all solutions. (There are two.) This is a pretty tricky problem, actually, if you don't think to use recursion. I was satisfied with pseudocode, but the Perl Mongers version was to fit the whole thing into 80 characters!
Back when I used to hire programmers (c 1990-2000) for a computer games company I used to run, we used to do a programming test during the interview and this weeded out a lot of people who claimed competence but really had none.
(My favourite example was someone who had written 'Assembly language programming' on their CV but didn't know how to answer the question 'for what processor?' in the interview. Also, I interviewed someone once who, when asked what their hobbies were, replied "I smoke a lot")
But what really astonished me was the level of BS on people's CVs. People claimed to have written famous hit games when they had not (we knew the people who actually did write them) or people who claimed to have worked for MI5, the CIA or Mossad. If they had worked for these organisations they wouldn't say so on their CV. If only out of self-preservation, never mind the Official Secrets Act. This made me think that a lot of the stuff on CVs that was harder to disprove was also BS.
In the words of Ronald Reagan: "Trust but verify!"
Matthew Stibbe on February 22, 2010 4:49 AM"Do not cheat and call your languages' equivalent of str_reverse."
Surely calling the use of built-in functions in a programming language "cheating" is somewhat excessive? I find it hard to believe you'd be looking for the kind of candidate that would prefer to invent their own broken-ass string parsing functions instead of relying on standard libraries.
I mean I understand what you're getting at, but "Nooooooo! Stop cheating!!!" seems like a pretty poor way to handle your own failure to write proper explicit instructions ;)
Pancentricholls on February 22, 2010 4:56 AMWell, the point is that they aren't testing whether you can reverse a string or not. They're testing whether you can come up with an algorithm to solve an arbitrary problem. String reverse is kind of a lame example when compared to what you'll ever actually have to do, but it's a reasonable test of whether you can think through iteration and loops.
Also, it's not just programmers who have this problem, it's really any skilled profession that doesn't have a meaningful certification. I've seen it interviewing carpenters. 3D graphic artists are the worst, because everyone who's a little artistic and has pirated a copy of 3d Studio max thinks they can apply for the job. We had I kid you not ten different applications whose portfolio consistent of the same 3D Studio tutorial.
Yrro Simyarin on February 22, 2010 5:01 AMMore than a decade ago I applied for a programming position and sure thing they made me code the solution to a rather complex problem. As it was my style back then, I wrote comments all over the code and I added an about message on top, sort of like: written by…
I didn’t get the job. They never really gave me an answer as to why. A few months later, a very good friend of mine got accepted to another position on the same company. He called me a few weeks later to tell me that he saw code that I wrote in one of the company’s main product. When I asked to describe the code he described what I wrote during the interview. However, what gave the code away was my about message and my comments: they didn’t even remove them! They just blatantly used my code.
In the following interviews I had over the years whenever someone asked me to write code as part of the interview, I would point them to my web site, then excuse myself and I would leave the interview. I DO NOT WRITE CODE ON INTERVIEWS!
That shows nothing.
My background: more than 20 years coding in C and ASM for Unix, Windows, and Mac. Over 10 years of information security consulting where I find exploits and vulnerabilities for common programs
Jeff,
Over the years I've used quizzes, on-site programming questions and take-home programming problems as part of of the interview and screening process. I'm always amazed at how much you learn by asking someone to write some code. I'm also amazed at how frequently people bomb these fairly easy problems. Sometimes I even have candidates that refuse to do the programming problem! It's like they feel offended that I'm asking them to demonstrate the very skill I'm considering hiring them for. The nerve of me!
While I think I've gotten better at screening and interviewing over the years, I think the best approach I've found is to hire people on a contingent basis for 3 months (consulting contract) with the understanding if both parties are satisfied about the arrangement after that time, then they will be converted to full-time.
Davraamides on February 22, 2010 5:04 AM@Andreir.wordpress.com
I feel compelled to point you to http://xkcd.com/385/
RancidBacon on February 22, 2010 5:14 AMThere should be an international association that accepts software developers into its ranks after some sort of peer assessment process. I have noticed a few of these while browsing the web, but I haven’t had a chance to assess their effectiveness or reach.
Accountants, doctors, lawyers and engineers have such associations with exams and strict qualifying criteria – programmers should to. I’m sure that NPPs will still sneak through, but I think that it would help.
"Do not cheat and call your languages' equivalent of str_reverse."
I have to agree with an above commenter here. While I understand the intent of the task you've set, you make it seem like this having to add it is a bad thing. Frankly, my first instinct would be to shoot for that with the idea that "Hey, I know the language, DRY, and surely this is a trick question just to weed out the people that can't focus on solving problems efficiently and quickly."
Considering I could write the function myself without trouble, I'd be more likely, after finding out I'd been dismissed for using the native function, to post about the company as "a company that doesn't even know the languages they are using and obviously using non-programmers to do the hiring."
Basically, if you are going to ask for coding samples or actual demonstrations of code writing, make sure you clarify what you want. After all, while you want a coder, you also want someone who get's the job done efficiently. And punishing someone for solving your problem within the limits outlined quickly and efficiently really suggests that maybe you aren't a great place to work.
Note, I'm not suggesting that this is the OP's work place. Rather, a warning to those who would use these methods.
Jason Lotito on February 22, 2010 5:24 AMI have to side with Ryan Bergman on this one. I've definitely been stumped by those academic-style questions before, and have grown to loathe them. Especially in the nerve-wracking environment of an uncomfortable interview. What those questions usually prove is not that I cannot program, but that I cannot remember the algorithm to do something off the top of my head. Give me the algorithm, and say "code this", and I'll be just fine.
But I really thing one of the bigger issues at hand is simply that most programmers have no portfolio they can show you. If all you ever work on are closed-source projects you don't own the rights to, then you can never share more than a bullet-point in a resume about them.
This is one area where participation in open-source projects can be very important, in my opinion. It gives you something you've worked on, in a calm environment, that you can openly show to anyone who is curious. Of course it can be a double-edged sword, and many people may simply not have time to do that in excess to their day job. Regardless, it is one possible solution to a problem that we all seem to have.
Dkonigs on February 22, 2010 5:25 AMPfff...it's easy to just say "they can't even program", but at the very least you should tell us what questions you're asking. Maybe the guy who wrote that article is a complete tool on the phone and very off putting...who knows. Easy to throw grenades.
fishstick_kitty on February 22, 2010 5:34 AMThe funniest of them all was a woman (don't get me wrong but... thing are the way they are) who couldn't find the modulo result and wrote a small function which iteratively subtracted one operand from the other until it hit zero or a negative value and took the decision from there on.
Isn't this exactly the sort of programmer you would want to hire?
She wasn't incompetent, like you claim, just ignorant. But despite her ignorance she figured out a way to calculate the modulus anyway.
Programming is about solving problems. Later you may learn an easier way to solve that problem but the important thing is to have a problem solving ability to start with.
mxcl on February 22, 2010 5:52 AMWhen I was beginning my professional career one of the first interviews I had asked me to write an array. This freaked me out and I couldn't answer. Not because I didn't know but because I felt like I hadn't heard the question correctly. I had passed the little test the placement put me on (Getting a 70-odd percent in SQL, even though SQL isn't my competence) and they thought I would be a good fit. The second interview had me do the exam by telephone. This sucked because you're stuck on the phone, thinking of an answer, but have to break your concentration so they don't think you hung up.
The third interview went much better. It was in person. We talked about my experience, resume stuff, and at the end they gave me a takeaway assignment. I had sent it back before the end of the day and had another interview a few days later. Although I was offered the job I didn't take it.
I do believe that the interview process can be a nerve-racking experience. Like dating, when you're taken everyone wants you. You're confident, experienced, have all the right answers. You are polished. When you're looking for work you are under pressure, lack confidence, and the stress can make things fall apart, quickly. Answering simple questions can send your mind racing.
BTW, I didn't take the job because I had made my mind up to do some travel. Malaria shots take 2-3 weeks before you can travel. Without worrying about being accepted, the interview was less threatening
Yardie on February 22, 2010 5:54 AM"I DO NOT WRITE CODE ON INTERVIEWS!"
Just write bad code. What's the problem? If all they want to see is whether you can program at all, doing a bad string reversal should be sufficient to differentiate from those who can't even do that.
While I tend (and want) to believe that application development is not computer science, I also think that some basic knowledge of computer science concepts are required, even if we always work with APIs rather than our own algorithms.
For the interview purpose I would assume that a string reversal that works on ASCII only is sufficient to show that I have an idea of what's going on. Framework-provided methods work on unicode as well. Excellent, that's why we use them.
Hey Now Jeff,
Programmers should be able to code & use SO for assistance with detailed questions. Nice Post.
Coding Horror Fan,
Catto
As sad as this might sound I have found this to be true in my 10 year career as Software Developer and Software Engineer.I had the opportunity to interview people for Software Engineer or programming positions in my career and even people with master degrees in this area could not code a simple program like just writing a function that receives 3 integers and return the max or the min of the 3 integers. I even try this question letting people know that they can do it in pseudo-code( so they don't feel the pressure on being perfect with the syntax of the language) with the same result.
What do you think?
eldeaca on February 22, 2010 6:12 AMThe problem is with languages which hide too being taught as the first programming language. I have had folks trying to brainwash me into believing me that knowing the details and the way things work under hood is a waste. A closer reading of http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html will give you an idea of things to expect.
I am not against Java (or any other easy to use language), learn to write code and understand how it works on the machine before thinking of abstractions. You cannot write programs knowing only design patterns, you still need to code!
Whew, luckily I've been able to solve all the questions in the comments (fairly quickly) and I'm not even a programmer. Anyone hiring?
Darren Newton on February 22, 2010 6:17 AMWow, where to start?
I think there should be some basic competency programming test, but it should be related to what the actual business needs. Here are two really quick examples.
I code in VB.net and C# for .Net1.1+. I have never taken a programming class. I am just a natural at learning and problem solving. At any rate, I was asked in a phone interview the difference between a linked list and an array. The company does not do low level programming or code for mobile devices which would make the performance between the objects perceptible. At any rate, I didn't get a callback. After my friend/colleague pointed me then to a site which has the "10 most common asked phone interview questions"...Well can you guess what I was asked on the next phone interview?
I had an actual in person interview with a web travel company. It was for a simple front-end/javascript/html/css development position. One of the interviewers asked me this complicated question regarding sheep, herdsmen and migration. I worked out the formula. He kept pushing for a different answer. I had no idea what he wanted. It made no sense. In the end he says "I was looking for 'Triangular Number'". Well I didn't go to school for math and have never heard that term of art for that formula. It wasn't enough to have solved it, but he wanted the exact term. AGAIN, this was for a simple front end job, much less complicated/difficult than was I was doing at the time.
After all, most jobs aren't at google or microsoft. They are corporate coding jobs. And just because you can solve a logic/programming problem doesn't mean you can solve complex business problems. These are the problems I face day to day.
I used to work as a fake programmer. Got sick and fed up with programming. Nowadays i'm a fake doctor, better paid and more interesting. ;-)
Aki on February 22, 2010 6:25 AMAn hiring manager not asking a programming applicant to write a simple program (or an applicant refusing to do so) would be like hiring a chef without asking them to cook you something first. Absurd. Of course, at a sufficient level of fame this may not be necessary, like already having been the head chef at a fantastic well-known restaurant, or verifiably the sole/main programmer of a great product. But that's not really who we're talking about.
Aside to Matthew Stibbe: other than the tiny percentage of CIA employees doing covert ops, you may not be able to talk specifically about what you did, but your employment history itself is not a secret. For most people working for the CIA and similar agencies, their friends, families, and subsequent employers are totally aware of where they work. (That's not to say that the people you interviewed weren't BS'ing you. But "if they did work for them, they wouldn't be able to say" is simply untrue.)
Lgritz on February 22, 2010 6:28 AMIn my opinion it's less about being able to program and more about being able to solve problems. All you have to do is spend an hour perusing Experts-Exchange to find out just how many people working as programmers can't research and/or solve the simplest of problems. People who will get an answer written in C# and then ask that the respondent write it in VB.NET for them. I recently was asked four questions in a phone pre-screen:
1. Name five of the events during a page life-cycle.
2. What happens between Init and Load.
3. Difference between HttpModule and HttpHandler.
4. What do these terms mean: abstract, protected, internal, static, virtual?
The person doing the screening said I was the first candidate to answer all of them without hesitation. One candidate told her that he usually is sitting in front of Google when doing a phone screen.
I think that's part of the problem. The internet has allowed us to share information in a way that wasn't possible when I entered the field 25 years ago. We had to figure it out ourselves (and walk uphill to school both ways in the snow). Now a person figures that if they don't know something they can always ask Google, and cut-and-paste the answer into their application. The problem is they never learn what all that cut-and-pasted code is actually doing.
Craig Wagner on February 22, 2010 6:36 AMi think it boils down to 2 things:
1. college is wayyyy too easy. it is very watered down. it is too easy to cheat in programming classes
2. programming is at least as much of an art as it is technical. how do you teach someone to get a feel for programming? maybe it's possible to offer guidance, but the actual ability to program can only come from the student. i think if the person doesn't have a knack for it, the only other way is practice practice practice, and it's clear that students aren't getting practice because of #1
A on February 22, 2010 6:44 AMetherpad is a great way to have the candidate write code when doing a phone interview.
Mitchmatuson on February 22, 2010 6:52 AMCraig,
I avoid the Googling problem on phone interviews by giving a test that is unique and relevant to the company. We're small enough that I can use it for a large number of interviews.
Using this technique has eliminated many interviewees that tried to Google their way through the interview. I had one candidate with "Excellent C/C++" abilities tell me at the end of the interview "I didn't expect to have to write any code. I just expected knowledge questions".
Do things differently from every one else and you have a solid way to screen candidates. By teh time we get someone in for an onsite interview we let them Google all they want to solve the problem we give them.
Matthew Parent on February 22, 2010 6:58 AMAsking about FizzBuzz in a job interview is all fine and dandy, but when you get hired and get asked to write an application that allows the Customer Service department to enter contract information into a database with customer data from one of the many databases in the corporation, and you will have to design the database, write stored procedures, and created a Forms or web application front end in .NET, then FizzBuzz and simultated linked lists aren't going to be of much help. I think the problem is with the interviewers and their questions more than the applicants "book knowledge".
Granted, some lines of software development, such as embedded systems and driver development. As such, perhaps the type of job interview should be clarified in these articles. I wouldn't care a damn if a developer couldn't write code for a linked list if (s)he is going to be doing .NET business software.
Hard Code on February 22, 2010 7:19 AMI'm pretty happy that back in the day there was nothing like this, because I was one of those programmers who couldn't program. I had to create a multimedia-show with Macromedia Director and about all I knew about Director was how to have a sprite move around the screen (no actual coding here).
Luckily my employer was a big organization and practically paid me to learn how to program Lingo. They even got me all the books I needed, for free.
If I hadn't had that job I probably would never have become a real programmer.
Mein_arsch on February 22, 2010 7:20 AM(Still can't edit comments, even with this new log-in scheme???)
The above sentence should have read:
Granted, some lines of software development, such as embedded systems and driver development would need such skills.
Hard Code on February 22, 2010 7:21 AMYes it is a huge problem, but I am not at all surprised at the overwhelming amount of incompetence in our industry.
- For the most part, it's the money. It is an industry that pays well. An industry that had two major peaks in the last decade alone. Peaks where almost anyone could get hired. In offshore locations, it is a way out of poverty. This results in millions of paycheck programmers, who lack passion.
- Most programmers work for companies and do enterprise application development. Increasingly, these programmers are considered commodities, a service that can be bought at an outsourcer. We all know that outsourcing is about cost reduction, not quality. For an outsourcer, billed hours count, not passion. It is in their best interest to have as many people as possible as sell them as competent as possible: seniors bring more revenue than juniors, so there is a motivation to cheat.
- Many employers are overasking. They demand you to be young and flexible, yet have many years of experience in a ton of technologies. The result of overasking is candidates overselling.
- Although a tech interview is common sense, quite often people are hired by non-programmers, who lack the skill to differentiate quality.
In the end, it is a lack of appreciation and knowledge of programmers that results in situation as it is now. That, and the cost/profit oriented world that we live in today. I suspect this is not unique to IT, you will find that a vast majority of workers in any industry would quit working today if they could. It's the mortgage that keeps many going, and work is tolerated suffering, not a passion. Guys like Jeff are in a lucky position to enjoy what they do, but not everyone has those possibilities. Don't look down on the ones who are not passionate. They are just people trying to make a living. They are not frauds or lazy by definition.
Finally, I too am against academic and math questions for application development positions. I have developed at huge multinationals for 10 years very successfully, but don't ask me how a Bubble sort works. I will understand how it works, but I don't recall it since I don't NEED to know how it works. Ask things that apply to the actual job.
PS: I would be against a registry of competent programmers. There are plenty of certification systems in place, and I do not consider it ethical to divide people like that. It is a lame excuse for saying that you are too lazy to assess candidates yourself.
Fchristant on February 22, 2010 7:25 AMI have found the same frustration when dealing with hiring sysadmins/netadmins/DBAs -- the seminal difference with those is that while your "senior programmer"'s ineptitude should be shaken out in QA, your "senior sysadmins" incompetence might get found out the first time he/she's on an overnight call by himself and brings down your production system(s).
I, too, have changed the way I do interviews: I always do a phone screen second. First, I make sure that people pass what I call my "0th order clown filter" -- that is, I make sure that those I solicit can actually read and follow simple directions. (Obviously, this doesn't apply when dealing with recruiters, the number of whom with a clue is a set of measure 0.)
I have also developed a pretty standard list of graded questions that allow me to quickly determine if letting someone loose on a production system/database/network is safe or highly ill-advised. (These are also questions that aren't easily discoverable via Google/Bing/Wolfram Alpha.) The downside to a standard set of questions is that if you deal with recruiters, the questions very quickly get passed back up and subsequent candidates from the same recruiter get prepared.
Other commenters' notes about "problem solving vs. programming" are well-taken, but if, coming in, your candidate can't show that he's got a reasonable-sized toolbox of problem solving already, you're going to spend a lot of time teaching him or her, rather than getting him or her to do the work -- which can be costly in the case of a "senior whatever".
Jerry B. Altzman on February 22, 2010 7:28 AMI hear this frequently, but it hasn't been my experience that it's as bad as you're portraying. Perhaps the recruiters I work with are better than most, but the people I interview tend to be able to do simple coding tasks. It's where more critical thought and problem solving is involved where they tend to fall flat, and where the failure of candidates starts to approach the degree you speak about.
My impression, however, is that -- as with many things with programmers -- ego is inflating the degree to which this is a problem. Not that it's NOT a problem, but to call it an "epidemic" is bordering on absurd. "Everyone I talk to is SO stupid that you wouldn't believe it!"
seinberg on February 22, 2010 7:41 AMSo boss.. am I hired?
for(int i = 1; i < 100; i++)
{
bool printNumber = true;
if (! i % 3 )
{
printNumber = false;
std::cout << "Fizz";
}
if (! i % 5 )
{
printNumber = false;
std::cout << "Buzz";
}
if (printNumber)
std::cout << i;
std::cout << std::endl;
}
Billy O'Neal on February 22, 2010 7:43 AM
Or a method in a C# Console App:
private static void FizzBuzzTest()
{
for (int i = 1; i < 100; i++)
{
if ((i % 3 == 0) && (i % 5 == 0)) Console.WriteLine("FizzBuzz");
else if (i % 3 == 0) Console.WriteLine("Fizz");
else if (i % 5 == 0) Console.WriteLine("Buzz");
else Console.WriteLine(i.ToString());
}
}
I went with 4 conditions instead of 3 for easier for debugging.
Just occurred to me that Billy and I made the same mistake the for statement should be:
for (int i = 1; i <= 100; i++)
we were missing the 100th display.
I think Techiferous hit the nail on the head. The more I learn the more I realize I still have a lot to learn. Wisdom breeds humility. I'm twice the programmer I was when I started my career and haven't even begun to approach the programmer I 'thought' I was back then.
Sadly, there are too many that have no desire for self-improvement and will sail through life thinking they achieved greatness when they're not even mediocre.
Kenneth Cochran on February 22, 2010 8:16 AMFog Creek started out doing phone screens and then in person interviews. The phone screens cut down on a lot of false positives, but we'd still have people come in, get picked up by the limo, stay two nights at the Ritz in Manhattan, and then come in for an interview and get 3 straight NO HIRES in a row. We added a screen sharing code interview in the mix, and saved *so* much time and money. Highly recommended. (We use Copilot and Etherpad to do the remote code interview).
Michael Pryor on February 22, 2010 8:28 AMJosh, I always do that. I always mess up some mundane detail.
Zack Peterson on February 22, 2010 8:30 AMI would still try and exercise a little judgment in the code example requirement. After all, python is one of the languages I like and
mystring[-1::-1]
to reverse a string fulfills the 'don't call string reverse requirement' but doesn't tell you anything other than I know and like array slicing in python.
Also, I initially tried signing in with facebook connect and it didn't like it very much. I allowed it to do what it wanted to do and I just got redirected to an openid page that was blank, then back here and it asked me to sign in again.
Not sure who I would talk to about that, but figured I would mention it.
Maybe you should make fixing the facebook connect signin your programming test for stack overflow candidates?
Mike Surel on February 22, 2010 8:43 AMWell, one thing to remember is the difference between Computer Science and Software Development. Some of you will say they are the same, but I will argue till I die that there is a HUGE difference.
I started out as a CS major, but after many classes with little programming and a LOT of theory I changed majors. I did not want to be a Computer Scientist... I wanted to be a computer programmer. My advisor did not recognize this, so I quit altogether and changed majors out of the college of Science and Technology.
I eventually went back and finished CS as a minor, but still wrote very few applications. Looking back, I know that the theory was needed and I use some of it, but I was learning about Big O and algorithm design, while my friends were at a JuCo learning Visual C and C++.
The point, if there is one, is that it's possible to go through college and get a Computer Science degree and know a lot of terms and theory, but not have super strong programming skills. It's the difference in paper skills and real skills. But the paper gets you an interview.
FizzBuzz won't tell you if a person can actually program, but it can tell you how a person thinks as well as how much experience they really have - after all, if kids can play the game correctly then it's not a hard problem. But if for example if someone started to writing this (pseudo code):
function Fizz (number integer) returns boolean
if (number mod 3 == 0) return true else false
end function
function Buzz(number integer) returns boolean
if (number mod 5 == 0) return true else false
end function
function FizzBuzz(number integer) returns boolean
return Fizz(number) AND Buzz(number)
end function
I would instantly know that they are a programmer, regardless of whether they even get time to finish the main program. Because of the approach they took.
Similarly, if I asked someone to do this in SQL and they asked me "well can I use a tally table" then right away I'd know that they would go on to write a set based solution as opposed to a loop or a cursor, meaning they were experienced, even if they never actually got the right solution in the interview.
Stephen Byrne on February 22, 2010 9:12 AMI'm stunned to see that candidates are not able to write a program to find if a given number is prime or not. Yesterday, I interviewed 10 people of which 8 were not able to write the program. It reminded me of your earlier post and today you have re-iterated the same.
VarunKumar Mallisetty on February 22, 2010 9:22 AMPaul Jungwirth wrote:
You have the numbers 123456789, in that order. Between each number, you must insert either nothing, a plus sign, or a multiplication sign, so that the resulting expression equals 2001. Write a program that prints all solutions. (There are two.)I think you meant 2002, not 2001. :)
(Just correcting for anyone else like me who obsessively tries to solve little "practice" problems like this one, and then hit Google when their result doesn't match the stated answer. ;) Damn, some of those Perl examples are ugly.)
esm on February 22, 2010 10:09 AMI once had the pleasure of interviewing candidates from the very bottom of the programming barrel. I rather enjoyed toying with these people... my favorite trick was to trap them and get them to back pedal to save face... for instance, I asked the question
It was TOOO funny, and rewarding... and I got to end the interview right after that. I think taking an extra 5 minutes out of your day to absolutely CRUSH their false sense of superiority is well worth the time.
I was asked to write FizzBuzz (although without the words Fizz and Buzz) when I was interviewing for my current job. It wasn't at the start of the interview, but it was the first part of the technical portion...
redsparrow.myopenid.com on February 22, 2010 10:51 AMI can see Google Wave being useful for this, too, as more and more people gain access to it.
Bill on February 22, 2010 10:54 AMIt's not just "programmers" who fake it. Remember Frank Abagnale Jr., who, before his 19th birthday, successfully conned millions of dollars by posing as a Pan American World Airways pilot, a Georgia doctor and Louisiana attorney and parish prosecutor.
The account of his story was dramatized in "Catch me if you can" starring Leonardo DiCaprio
Guy on February 22, 2010 11:26 AMCrikey! And here's me going for network support jobs and call centre gigs because I can't find a coding position that pays the bills!
Daniel on February 22, 2010 11:47 AMThe numbers sound bad, but this article reminds me of a day some years past when our HR person came laughing to our office, telling that the company had just received an application for a C++ developer job...from a truck driver...aged 50...never worked on a computer...who had simply said in the application that he was bored with his current job and wanted some change.
Those were the mad dotcom days. No, wait! Those were the days almost half a decade after them. Maybe the news travel slow in the trucking business.
Murmutti on February 22, 2010 12:07 PMVarunKumar Mallisetty wrote:
I'm stunned to see that candidates are not able to write a program to find if a given number is prime or not.
Well, what kind of software is your team writing? If it's mathematically based, or in a laboratory, then fine; they need a solid math background.
If your team is writing a payroll application or an ERP system, you are asking the wrong questions and potentially losing out on good developers. I've been writing lots of software for years as an in-house developer, and I couldn't write nor care less about a program that tells if a given number is prime. It doesn't apply to a huge segment of software developers.
Hard Code on February 22, 2010 12:14 PM@Paul Jungwirth
"You have the numbers 123456789, in that order. Between each number, you must insert either nothing, a plus sign, or a multiplication sign, so that the resulting expression equals 2001. Write a program that prints all solutions. (There are two.)"
So is this with left-to-right evaluation or with precedence (i.e. multiplication is done first)?
The point of the string reverse function is not to find out if the candidate knows the language. The purpose is to find out if the candidate understands looping (or perhaps recursion).
Leauki wrote:
> For the interview purpose I would assume that a string reversal that
> works on ASCII only is sufficient to show that I have an idea of what's
> going on. Framework-provided methods work on unicode as well.
> Excellent, that's why we use them.
Ugh. If anyone I had every use the reverse a string problem on had ever asked me about string encoding or mentioned the word Unicode or actually wrote the function to reverse a UTF-8 string in place. I would have died from shock right during the interview. Last time I did any interviewing only one person got the ASCII string reverse function close to correct. 60% of applicants did not answer the question at all.
Joe on February 22, 2010 12:36 PMJust out of interest has anyone ever had to reverse a string in place?
Apart from interviews I can think of a case in 20years of programming.
I have never had to test if a number is prime or write my own sort function either ( I did once have to write a hash for an embedded platform)
Mgb on February 22, 2010 1:03 PMesm is right: I meant 2002, not 2001. I'm very sorry to anyone who wasted time because of my bad memory!
Paul
Paul Jungwirth on February 22, 2010 1:09 PMI suppose people with a computer science background have sort of a bias to some problems, such as finding primes of a number, that might look "hard" to anyone with a more trade schooly education. I think, though, if a programmer thinks that's too mathy, there's plenty of problems they're going to run into in their jobs that will give them grief. It might "just" be business programming but that doesn't excuse you from not knowing how to solve one of the very most basic calculation problems an interviewer could ask.
If you phrase the problem as such: Make a function that returns false if the number is divisible by any other (natural) number than 1 or itself.
You're not seriously suggesting a competent programmer shouldn't be able to do this right?
WimD on February 22, 2010 1:21 PMOk I fail, did not know what "Sharding" is. Techies and their need for new jargon back in my DBA days we used horizontal partitioning and were happy about it.
William Dieterich on February 22, 2010 1:25 PM@Hughdbrown
> So is this with left-to-right evaluation or with precedence?
Assume ordinary rules of precedence: multiplication before addition.
Paul Jungwirth on February 22, 2010 1:25 PMFor string reversal, if given a choice of any language and not allowed to use an API, I'd use python just to screw with you.
s = 'somestring'
print s[::-1]
I've encountered 'language trivia' interview questions too many times. Unless you're explicit about wanting an algorithm (and most programmers would be explicit, or at least admit defeat when someone pointed out the vagueness), I would immediately jump to the shortest correct solution: built-in language features.
Matt Garrison on February 22, 2010 1:34 PMFor the benefit of the non-programmers (like myself) that would like to learn to become good programmers, what practical advice can you give?
These days, there is a plethora of courses, books, websites, about programming, and an ever-growing number of programming languages. Being a non-programmer I find it difficult to distinguish between the good and the bad.
When I (try to) code, the biggest difficulty I find is knowing the "right" way to code, that is, my finished product does the job, but I have no idea if it is the most elegant solution, or the most secure solution.
Is there a book or course or recommended beginner's programming language and approach that is best for non-programmers? I see a lot of books about how to code in this or that programming language, but very few seem to teach you the correct general programming approach, or use real-world examples that are useful.
Thanks all.
Andrew Zen on February 22, 2010 1:56 PMYou: "In any language you like (with no attention paid to getting every last semi-colon in the right place) write a function that reverses a string."
Me: (writes a function that simply calls a standard library string-reversing function)
You: "Do not cheat and call your languages' equivalent of str_reverse."
Me: "Um... really?" (thinks for a moment) "Can I use my language's implementation of a stack, or do you want me to reinvent that wheel too?"
You: "I think we're done here."
Nothinghappens on February 22, 2010 1:57 PMTo understand why people try and get programmer jobs who cannot program, it helps to understand a common job tactic a lot of people use.
In most business jobs it is easily possible to fake out an interview and get a job you have no experience of. After three months most people have gained enough knowledge of the job to function to a degree where it is not worth firing the person. I have a few friends who have blagged thier way through whole careers using this technique.
Now to a person who has no knowledge of programming, they have no idea how easy it is to spot a rubbish coder in this industry, let alone a complete incompetent. But being a programmer is regarded as a lucrative career so people are going to try it on. Sad but true.
On the subject of having too many interviews I did read an only partially tongue in cheek method:
Divide the cv's into two piles.
Bin one pile because you don't want to hire anyone unlucky.
@Mary Contrary. I laughed with your "recommendation". However, it reminds me of the "Tautology Club" xkcd comic from few days ago...
Jeeyoung Kim on February 22, 2010 3:17 PM@Andrew Zen - learn algorithms - with this you will be able to do anything. Do not bother to focus on syntax beyond the extent which is required to practice algorithms in a language you choose. I absolutely hate programming tests which focus on syntax - that's what makes "FizzBuzz" such a great question, especially when asked to write pseudo-code. Learn the popular algorithms, such as QuickSort and Binary Search - but don't just learn what they do, learn why they work, and how they are derived - so, start with the basic algorithms like Bubble Sort and Linear Search, and learn how and why the improvements exist. Learn to find similar improvements in your own algorithms - if you take a shower every day, figure out how to make that more efficient, or prove that it's as efficient as possible - learn to recognize why.
In 25 years of programming, I have used maybe 20 languages, most of which aren't used any more - knowing the syntax of those dead languages is useless today, and knowing C# and the .Net Framework will be useless tomorrow. Knowing how to find an algorithm to solve a problem will serve me well a long time into the future. This is the basic skill that is lacking in a lot of programmers today - they have no ability to think up an algorithm for anything. Colleges are teaching syntax, HR is testing syntax, even certification exams are testing syntax - and they are all missing the target.
Learn how code works, in general, and don't get bogged down in the format and syntax of a particular language. BTW - there is a book called "Programming for Dummies" - from the popular series of bright yellow "dummies" books. It is one of my most treasured possessions, but I loan it out on occasion - in fact I didn't buy it for myself, I bought it for a friend who wasn't learning coding in his college classes. I highly suggest you pick up this book - it is straight to the point about what you need to do to write code, and it's not "academic" like Code Complete and some of the others on Jeff's list.
Jasmine Adamson on February 22, 2010 3:20 PMDon't underestimate the conditions of an interview process. If you think that's similar to the pressure of a deadline by proxy, I disagree. I've worked with very good programmers who I think disintegrate under the scrutiny of someone who looks quizically at them when they've been used to (for years) people trusting their judgement. Hell there are even psychological experiments which can coerce people into non-natural behaviour (think the Milgram experiment as an extreme example).
The most difficult thing to evaluate and the most important aspect of a candidate is how hard they work. You can hire someone who can recite an algorithm or do The Times crossword in ten minutes but if you only get ten minutes of work out of them a day then they're fucking useless.
Another thing I've noticed is how poorly people are trained to interview potential candidates. How many companies track the ability of an interviewer?
The fact is, is that in most cases people hire people who are like them.
Tonylo on February 22, 2010 4:00 PMI am, frankly, appalled at some of the responses here from "experienced" programmers.
"What is the next hex number after F" is NOT an obscure question that very few programmers will know the answer to. It is a very basic thing that (over here at least) we get taught in our first year of Uni, which is redundant as we also get taught it before we ever reach Uni. That's part of the number systems material where we get octal, binary and hex. Admittedly there is only a nod to octal, I can't do much with it in my head still. That's alongside the boolean logic and finite state machine material taught in other classes.
I fail to see how you can possibly have 10 year professional experience in programming (or even 10 years amateur experience) without ever reading or using hex numbers. It's not like not knowing an API, a pattern, or even a language. This is a basic thing inherent to computing.
John Kemp on February 22, 2010 4:12 PMI'm an old school programmer. Old, old school. Punched paper card old. I read Ellen Ullman's article, about 10 years ago ("The dumbing-down of programming", or something like that), and I felt almost proud of being obsolete. But the world kept going round, and since last year I began to revamp my skills, got my C# and my .NET together (great choice for old-timers, by the way) - begginer's level, but I'm psyched - and it all seems to be coming back again.
I'm just trying to say that, back in my student days, teachers didn't pretend to teach, and we didn't pretend to learn. Why? Not because we were braver and more virtuous (trust me on that), but simply because it was impossible. Productivity begins with honesty, and if honesty is not rewarded, well, now you know what happens.
Aslemos on February 22, 2010 4:21 PMTonylo>> The fact is, is that in most cases people hire people who are like them
It's also said that generally people don't hire staff who are smarter than themself, often because they can't recognize talent and sometimes because they don't want to hire a person that may become a threat and ultimately become their successor
John Kenp>> I am, frankly, appalled at some of the responses here from "experienced" programmers
+1!
Martin on February 22, 2010 4:30 PM@Martin, I've rarely (fortunately) found that programmers in a position to have a choice are that cynical - usually because the net effect will hit them. Manager's and marketeers are a different matter :)
Tonylo on February 22, 2010 5:03 PMOh my.
Why the heck are people applying for a job they can't do?
Ivey Cook on February 22, 2010 5:53 PMAs recent graduate with a BS in Computer Science, and one looking for a J-O-B. Some of these questions are trivial, but a lot of times you haven't thought about them since your initial classes. Your head is full of random trivia or more complicated stuff like polymorphism, threading, differences in SDLCs, and which UML diagram you should use. I haven't had a "programming" class since Freshman year (unless you count assembly--soph). Most classes/Uni. Programs are skimping on the code monkey, and concentrating on how to properly design/engineer a solution. So us newly graduated ARE lacking in the actual coding experience it doesn't mean we can't program, just that we haven't done it.
as a newbie programmer myself, mostly versed in Python and C/C++, and with very very weak math skills... many of these questions would take me much longer to solve than most programmers. I could solve them, and likely in an unexpected way.
anyway. The biggest issue is always going to be whether the applicant has the skills to learn. No environment is the same, and no skillsets and knowledge base are going to match up perfectly.
So what the guy said previously about learning algorithms is probably the best comment here. I know next to nothing about most syntax, and I suck at math, but once I learn the methodology of an algorithm i can translate that to any language, with just a little bit of learning.
the guy who cant learn is going to be stuck with a missmatched set of skills.
Nesetalis Anderson on February 22, 2010 6:04 PMI think what I'm what I'm geting out of this is that anybody looking for a programming job should brush up on their CS 101 textbook exercises? I tend to side with Joseph Connolly's 6:22 AM post: sometimes interviewers are looking for a "stock" answer, and someone without a Math or CS degree will never know the magic phrase.
I'm not so sure that being able to code a "small" program like a linked list will accurately predict someone's competence as a programmer (although I agree it's a reasonable baseline requirement for any applicant with a CS degree or 5+ years of experience).
When I interview candidates, I always show them a "Rorschach Test" - a Java class that is a sort of Frankenstein monster of unclean code, anti-patterns and lurking runtime exceptions (all lifted from "Production" code I've had to support over the years). I would show them the code and say "this code compiles and is functional, but it's got some problems. How would you make it better?"
The best candidates would look at it and laughingly go through all the problems and start discussing refactorings. The worst candidates - some who had newly-minted CS degrees and no doubt could crank out a mean linked list implementation - would stare blankly at the sheet for several minutes or even say (unbelievably) "looks pretty good!"
Finally, I've noticed some of the comments here are by people who have apparently used the interview process as an opportunity to "toy" with candidates and thus boost their own ego. Unprofessional and lame.
Noahlz on February 22, 2010 6:48 PMJeff it's possible you're only hearing about the totally unqualified applicants. The decent-or-better candidates don't make for interesting interview stories.
Matthew Krieger on February 22, 2010 7:04 PMTo anyone who's trying to figure out why so many interview candidates are bad, you should read this Joel on Software article (from 2005): http://www.joelonsoftware.com/items/2005/01/27.html
DLitz on February 22, 2010 7:08 PM@Jasmine Adamson Thanks for the advice. I'll check out that book too - I have no qualms being a dummy. But I'll make sure I'm up-to-scratch before I start applying for, and attending interviews for, programming jobs.
Andrew Zen on February 22, 2010 7:40 PMThe worst thing about all this - apart from having to work with them - is realizing they keep average salaries down, because business have to worry about being profitable with some of these no-hopers on their team.
alex.james.myopenid.com on February 22, 2010 7:43 PM@Paul Jungwirth
You have the numbers 123456789, in that order. Between each number, you must insert either nothing, a plus sign, or a multiplication sign, so that the resulting expression equals [2002]. Write a program that prints all solutions. (There are two.) This is a pretty tricky problem, actually, if you don't think to use recursion. I was satisfied with pseudocode, but the Perl Mongers version was to fit the whole thing into 80 characters!
There's probably a more CPU-efficient way to do this, but considering how much I'm being paid and how important time-to-market is, you would probably rather that I sacrifice CPU time for developer time, as long as the code's clear enough for somebody to optimize later; I can optimize it later when the situation calls for it.
In Ruby:
# Represent a nonnegative integer as a fixed-length array in base 3 (little endian),
# using the symbols "", "*", and "+".
#
# Example:
# base3(0,3) # => ["", "", ""]
# base3(1,3) # => ["*", "", ""]
# base3(2,3) # => ["+", "", ""]
# base3(3,3) # => ["", "*", ""]
def base3(n, len)
symbol_space = ["", "*", "+"]
retval = []
len.times do
retval << symbol_space[n % 3]
n /= 3
end
retval
end
# XXX - This is slow (O(3**n)). Luckily, with a string of length 9,
# we only have to do 6561 iterations.
s = "123456789"
s = s.split("") # Split into array: ["1", "2", ..., "9"]
(0..3**(s.length-1)-1).each do |n| # iterate through all possible combinations
ops = base3(n, s.length-1)
expr = s.zip(ops).flatten.join
puts expr if eval(expr) == 2002
end
# I should get extra credit for figuring out how to indent stuff on this blog. (Hint: U+00A0)
DLitz on February 22, 2010 7:57 PMThe problem I have with these mathematics-based questions is just that: math. I am not very quick at math, but give me some time and I'll get it. The other thing is that I have only ever needed to use mod a few times in the 10 years I've done development (alternating row CSS anyone?! Thank God for CSS3 selectors). I suppose it's good the first thing that came to my mind with the FizzBuzz was a mod solution, but I always forget how it works. I don't do a lot of math heavy programming though and I didn't come from the comp sci school, I learned by myself.
I'd rather be asked to build a simple app rather than a math-based problem. I like the idea of asking for a code sample. I'd feel a lot better giving someone a polished code sample... but I understand the need for on-the-spot questioning to determine how well someone can do something on their own.
Kamran Ayub on February 22, 2010 8:45 PMI have a really simple solution to the "insert operators into 123456789 to add up to 2002" problem.
It may not be the most elegant, or recursive, but it took only a couple of minutes to conceive, type, and execute.
Using bash:
for e in 1{,+,*}2{,+,*}3{,+,*}4{,+,*}5{,+,*}6{,+,*}7{,+,*}8{,+,*}9; do echo $e = $(($e)); done | grep '= 2002'
itub on February 22, 2010 9:04 PMone thing that you haven't mentioned (and i'm not sure if anyone else has) the non-programming programmer takes away the job of a programmer. which is bad for the programmer, the company, and any potential customer of that company. so considering so many of them actually make it to the interview in the first place.... how can the programming-able programmer distinguish himself from the one who can not actually program.
should i add a line to my resume saying "i can actually program" ?
would be nice if someone could come up with a way of helping all involved, the programmer who wants the job, the interviewer who would be very happy of never having to actually interview someone who can't program, and the company that does the hiring.
i'm thinking a web based application process wouldn't be a bad thing, some little flash application that records all the keystrokes of a simple programming question (just so you rule out the ctrl-V people) and give the people who succeed a GUID of some sort which they have to put on their application. then you start by interviewing the people who have completed the simple question and only if you run out of applicants who have done that you start interviewing those who have not (and probably ask them to finish it before coming in for the interview, or before you call them).
Not to pound on a dying horse, but who could possibly care about a gotcha question like how to find the smallest common multiple of two integers? What's sad is interview questions that aim to demonstrate the omnipotence of the questioner rather than gauge someone's fitness for solving real business problems in code.
Glen Ford on February 22, 2010 9:07 PMI'm astonished at how many responses are along the lines of, "Interview Question X is no good, because I've been programming for 10/20/30 years and never had to do anything like that."
Do you really want to present yourself as someone who can only handle problems you've already solved in the past?
Mikeash on February 22, 2010 9:09 PMI think you are approaching your question "why do people who can't write a simple program even entertain the idea they can get jobs as working programmers?" the wrong way. As a fellow passionate developer it is easy to look at what these people do as not in line with our ideals, that they are frauds and should be ashamed of themselves.
The truth is much simpler. Most universities are structured in a way such that you can attain a degree without knowing the subject all that well (whether that be by cheating or just barely passing). This is true not of just CS, but many degrees. So you end up with a student who owes a lot of money with a piece of paper that says he knows how to program, what do you expect him to do?
Brandon Malicoat on February 22, 2010 10:03 PMThe comments to this entry are closed.
|
|
Traffic Stats |