tags:

views:

89

answers:

6

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?

+1  A: 

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.

Octavian Damiean
+2  A: 

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.

Martin Bean
+4  A: 

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.

Alex
Do you not feel that such an interview would be overkill for what seems like a basic PHP role at a company where the bottom line probably isn't on the quality of the software?
EnderMB
@Ender: is asking for a bright and result-centered worker an overkill?
Raveren
@Raveren Joel Spolsky's methods work for him and large tech companies, but if the average company with a presence on the web gets a bunch of hopefuls in there's a very good chance that in your search for a rock-star developer you end up with no one who meets your overly-high standards, especially if you're only looking for someone who can maintain and upgrade your bespoke internal systems when needed.
EnderMB
+1  A: 

If you need BASIC exam, I'd recommend:

http://www.w3schools.com/PHP/php_quiz.asp

shamittomar
ohgod, terrible beyond words
Raveren
@Raveren, yeah that's what *BASIC level* is :)
shamittomar
No, *terrible* describes it better. Did you take it? Ridiculous questions and the appropriate ones can be bypassed simply by asking to write an easy loop from the interviewee.
Raveren
Wow. I got 20/20. I must be amazingly gifted(!)
Martin Bean
@Martin, bingo you passed *basic* level :)
shamittomar
+1  A: 

You can also see how he would handle exceptions.

Ben
+2  A: 

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.

  1. 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.
  2. 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.

EnderMB
Thanx for taking the time to write that, and to everyone else who helped out! If I could choose more than one answer I would. But alas, thanx again though guys!
You're very welcome. Good luck with your developer hunt!
EnderMB