My boss just asked me to write a little test for people that are applying for a new PHP developer position here. Since this is the first time I've been told to do such a thing, I was wondering what you guys think the test should contain?
I was thinking about something like a simple PHP login system: I think it covers most of the bases, but if there is something better you can think of, please post it below!
Basically, what are your opinions on what a decent PHP programmer should know?
I'd probably break it down into two segments, a basic Q&A session about the job, with some PHP, SQL and basic (but always standards-compliant) HTML and CSS questions. Shamittomar has provided a link to a good set of PHP questions and I would highly recommend using them.
Once this part is done and their brains feel thoroughly warmed-up I would give them two tasks to do.
I find this to be the best compromise between simply looking at examples of code they're written and giving a full Joel Spolsky style interrogation. Give an applicant this test and you'll more than likely find someone with the level of competence you require, or someone who really isn't far from what you need.
I suggest you read http://www.joelonsoftware.com/articles/GuerrillaInterviewing3.html which is a great guide about hiring programmers.
The essential point is: It's not so much about the test you give them, it's about putting your applications into a discussion so you can figure out if they are smart or not.
A good one I was asked is, could I explain the different between public, private and protected properties and methods.
If you want to go down the object-orientated questioning route, ask the candidate what's the difference between a function and a method.
Write a piece of code which contains errors and is not optimally written. It should contain multiple errors from all sections of programming. Like I mean all kinds of possible errors.
PHP programmers often have to adopt a project and that as fast as possible so they have to be able to spot errors and find optimization opportunities where needed.
If you need BASIC exam, I'd recommend:
You can also see how he would handle exceptions.