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 w开发者_StackOverflowondering 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 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.
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.
- Write a basic script of your choosing, something that the business already uses that should only take a small amount of time to complete. You're hiring someone to write code, so they should be able to write basic PHP code fairly easily. Give them a blank computer with a clear history and tell them you'll be watching them, and after the test you'll be viewing what resources they use to get the problem sorted. Obviously, someone who can work his way around PHP.net to find whatever documentation he/she needs isn't entirely stupid.
- Fix a fairly complex script that you have written, provided only with a basic specification, descriptions from you of what the script is to do and a broken script you have pre-prepared. My last boss used to do this by writing a script himself, taking a note of every mistake he made and adding them back in at the end; at least that way the code itself wasn't broken beyond repair.
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.
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:
http://www.w3schools.com/PHP/php_quiz.asp
You can also see how he would handle exceptions.
精彩评论