Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm looking for some small programming projects that I can give potential employees to gauge their programming abilities. These will be programmers straight out of college. I'm looking for projects that would take someone a couple of hours and they would email back their answers post-interview.

One example would be to take this paragraph of text and return a list of alphabetized unique words. After each word tell me how many times the word appeared and in what sentance(s) the word appreared in.

Anyone have any good suggestions?

share|improve this question
    
ACM programming contest questions. You can find an archive of those questions here. –  whatsisname Mar 18 '11 at 14:16
1  
Would these programming puzzle sites be interesting to you? programmers.stackexchange.com/questions/756/programming-puzzles/… –  grokus Mar 18 '11 at 15:38
add comment

closed as not constructive by Jimmy Hoffa, MichaelT, jimwise, Glenn Nelson, Robert Harvey Feb 1 '13 at 21:25

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

9 Answers

up vote 25 down vote accepted

I've long-since concluded that nothing someone can do in a short time can tell me anything useful about that person. But every good candidate has personal projects already written which can tell you a lot. So I've replaced specific challenges with "give me a piece of code which you're proud of and happy to stamp your name to."

Their choice of project tells you more than any hour-long task. And then you can spend an hour discussing it to learn even more.

share|improve this answer
    
That is a good point - thanks. –  bigtang Mar 18 '11 at 15:14
    
I remember interviewing at a company and being given a fairly simple (15-20 line) function and being asked "What does this do?" I told them, then asked "Does anyone get that wrong?". I was told that the majority of people they had interviewed couldn't answer. Maybe that's a quick alternative (I don't know anyone who can read code that can't write it, but maybe I just haven't met the wrong people). –  TMN Mar 18 '11 at 16:41
4  
@TMN - Oh, we do that a bit as well. But I have met people who can read code and not write it well. –  pdr Mar 18 '11 at 16:45
    
@TMN Being self taught, I spent a significant amount of time reading code early on to the point of being far better at reading it than writing it. It can and does happen, it just takes time and practice to bring the writing it skill up. –  Jimmy Hoffa Aug 22 '13 at 2:31
add comment

I used my Senior Design class project as an example in all of my interviews. It was a Webcam Mouse system (You moved your hand in front of the camera, it moved the mouse) Pretty simple stuff but it seemed to impress them cause I could say stuff like "OpenCV" and "Image Detection" and such. :)

share|improve this answer
add comment

I've only interviewed with once company that has done this. They gave a question sheet of 6 or 7 problems. The instructions were to make a method to solve each problem.

One part of the task was to realize that you could reuse code. Problems could use code from other solutions. It wasn't sequential either. For example, question 3 could be written using the method used for question 5.

I would suggest trying something like that.

As for the questions? Some of the starting questions on the Project Euler site are good.

You could also try a simple game if you want to see how they can put a project together.

Or, if you don't want to come up with something, ask them to send you in some code from a final project.

share|improve this answer
add comment

Allowing someone to do a practical project on their own time doesn't necessarily mean it is them who does it.

Everyone arrives early for an interview (well, should at least). We have a 'while you wait' sheet for them to work on until we are ready to see them. It has eight (8) questions that test an applicants knowledge in the language we primarily use.

We are not looking for the answers to all be right, as anyone can get them right with a computer in front of them. We are looking for process, do they even attempt the question, how do they come to their answers.

When we come into the interview we go over it with them and answer any questions they may have which can also lead them to getting the correct answer. It also allows us to ask how they got the answers they came up with.

This combined with previous work, we find, are the best ways to filter out candidates.

share|improve this answer
1  
This is sort of brilliant. I like it! –  davidhaskins Mar 18 '11 at 15:41
1  
although i have been in many interviews that turn into trivia. Be careful not to get bogged down on this particular bit of sysntax and get onto their large scale understanding. Especially if they are alleged to have a bit of talent or interest. the result was i didnt want to work for them, and im sure it was mutual. –  John Nicholas Mar 18 '11 at 15:49
    
"Allowing someone to do a practical project on their own time doesn't necessarily mean it is them who does it" - True, but I've not yet come across someone brave enough to come into an interview and be questioned on code they haven't written. Should it happen, they're not going to get through the interview and their probation, but I may reconsider my approach. –  pdr Mar 18 '11 at 15:50
    
@John. Agreed, it can't be "oh, you forgot a comma there". As I mentioned it is to get an understanding on how the approach things and if they understand the language. If they know their stuff definitely move on to the bigger things. –  RDL Mar 18 '11 at 17:32
1  
@RDL, Most of our interview process is designed to be kinda fun to the kind of developer we're looking for and hell for the rest. You know how good devs can't resist a challenge. –  pdr Mar 18 '11 at 18:00
show 4 more comments

Have them implement Conway's Game of Life for whatever language you're looking at, using that language's design paradigms.

A Java or C# Conway's Game of Life should be object oriented, LISP or F# would be functional, etc.

share|improve this answer
1  
How long would you give them to complete this? –  Job Mar 18 '11 at 15:44
    
It takes me about 4 hours to get through a whole OO implementation of it, but I've done it about a dozen times now. If you want to see how they think and how far they get (and whether or not they write testable code), give them less time than that. If you do it in person, then give them 45 minutes and see how far they get and why they chose the path they did. It's one of those problems that you want them to know about ahead of time so they aren't totally lost, even encourage them to try it on their own. It reveals a lot about a programmer. –  George Stocker Mar 18 '11 at 15:49
add comment

I get so tired of this mind-gamey crap. I've been at places that asked me for code samples, ripped them apart, and then asked me to explain example code from their systems that looked like it was written by cracked out 2 year olds. I've been asked to implement obscure sort algorythms, network services, guis, data structures (always either a tree or a linked list). Every flavor of fiddling annoying question about whatever the interviewer thinks is the most important part of programming.

In the end it's all pretty much useless. The best way to evaluate an employee is to hire him for 30 days, and see how well he does the work. Spend all the time you want developing tests, and it won't tell you a thing about how someone works on a day-to-day basis.

share|improve this answer
2  
Coding a simple algorithm like the one bigtang described is not "mind-gamey" in the least. Being able to do something like that should be a prerequisite to even getting an interview (and it is, at my company). It's very useful for screening out candidates who otherwise look great on paper. The last thing I want to do is spend hours interviewing someone who can't write a function to tell if a string is a palindrome. You'd be amazed at the number of CS PhDs from top schools who can't do bigtang's test. In short, being able to complete a test like this is necessary but not sufficient. –  Jer Oct 18 '11 at 18:56
add comment

One example would be to take this paragraph of text and return a list of alphabetized unique words. After each word tell me how many times the word appeared and in what sentance(s) the word appreared in.

What language would they write this in? If they are coming out of a school that focuses heavily on C, this wouldn't be quite as quick to write as one that teaches Python/Perl/Ruby etc... Or even Java or C#. Nonetheless, it is a good little test.

I suggest some easier ones actually during the interview. No trick questions. I'm with TMN on this one. Give them a couple of functions that do basic tasks and ask what they do (reading other people's code). Then give them a couple of basic tasks (<20 lines) to write in a language of their choice. That should be enough for an entry level to know if they can code or not (at an entry level position). That along with the interview and GPA should give you a good idea on what you need to know.

share|improve this answer
    
I don't find the language critical, it can even be done with pseudo-code. The main idea is to see if the presumptive employee "gets in there" and shows good signs of problem solving. –  Jonas Byström Sep 7 '12 at 11:16
add comment

Respectfully, if you're not clever enough to come up with a decent project on your own, what makes you think you're clever enough to evaluate candidates' submissions?

If you're going to ask people to complete a project, you should have a specific set of skills that you want to evaluate in mind and design the project to test those skills.

One example would be to take this paragraph of text and return a list of alphabetized unique words. After each word tell me how many times the word appeared and in what sentance(s) the word appreared in.

What are you looking for with this question? How many ways are there to solve it, and what does each approach tell you about the person that wrote the answer? Are the skills demonstrated by an effective answer to this question the same skills that are most important to your business?

I don't want the answers to these questions; I just want you to have thought about the answers before you subject a group of candidates to your process. If you know what skills you're looking for, creating a question to look for those skills isn't hard. If you use someone else's question without a thorough understanding of what it was designed to evaluate (if anything), you're really just fooling yourself and wasting everybody's time.

share|improve this answer
    
Sorry to have wasted your time. –  bigtang Sep 9 '11 at 20:47
    
@bigtang, it's not that at all. Sorry if the above comes off as a rant -- I can see how it might -- but my goal was to build a case for creating your own project based on the skills you're looking for in new hires. You can make a little project out of almost anything, but to make it worthwhile for both you and the interviewees, the requirements should be driven by the skills you value most. –  Caleb Sep 9 '11 at 21:13
add comment

You might want to check out Jon Jagger's fantastic Cyber-Dojo.

It's a web based integrated environment designed for doing deliberate practice of Test Driven Development and learning about team dynamics. It has lots of small programming tasks (kata's) and supports a range of languages, from Python and Ruby to Java and C++.

Unlike IDE's designed for productivity, there is no code-completion, syntax highlighting or auto-refactoring, so you get to see what your interviewee can do without these.

The best thing is, after doing a kata you can then go back and look at the red/green progression (or maybe not if they don't do TDD *8') of each of kata. Every compile/test commits the changes to a git repository along with the results of the test.

I think using this for interview coding tests could tell you a lot about not only a candidates ability to solve a problem, but also their approach to problem solving and the process they use when not constrained by external factors, just select a kata appropriate to the time you want the candidate spend on it.

If you want your own CyberDojo server, the whole project can be found at github and there is even a Turnkey Linux appliance virtual machine linked from there, which means that assuming you already have VMware player or VirtualBox installed, you can be up and running within a few minutes of downloading the appliance!

share|improve this answer
    
Sounds pretty cool - I'll check it out - thanks. –  bigtang Apr 5 '12 at 12:50
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.