First, I wouldn't be worried about asking questions that are too specific or asking too many of them.
As an example of why specific questions are important, when I was interviewing for my current position the bulk of the interview (at least an hour) was spent going over various programming questions.
I was asked to write the following code examples on a white board for scrutiny or answer these questions:
- What is POST, GET, SESSION and how do they differ
- Simple Select Statement
- Select Statement with Joins and a Where Clause
- Example of recursion (specifically removing slashes from $_POST)
- Example of connecting the database, executing the query, and then outputting the result
- What is inheritance? polymorphism? encapsulation?
- Show an example of inheritance
- Are you familiar with Model-View-Controller
- What data abstraction patterns have you employed? Please demonstrate
- What frameworks are you familiar with? What did you like / not like about each
The more specific you are during the interview, the more pleased you'll be later. As someone once said regarding marriage, "during courtship keep your eyes wide open." And I believe that the same is absolutely true when looking to hire a new programmer.
There are a few similar questions on StackOverflow:
Code
Resources
Ask for a detailed list of PHP resources the candidate uses. Books, blogs, forums, magazines, etc. That's how my current employers found out about StackOverflow.
If the candidate mentions StackOverflow or Programmers, you should NOT ask or try to find out their username. If they wanted to advertise their reputation they would have included a Careers 2.0 link on their resume.
Frameworks
Every PHP developer should know of the most popular PHP frameworks:
and be fluent in at least one of them. You can have a few code samples ready for each one and ask the candidate to read and explain them, after they tell you which one they are more familiar with.
Debugging & Profiling
I've always felt that PHP developers are lacking debugging and profiling skills (perhaps only the PHP developers I've worked with). If during the discussion you find out that the candidate actively uses xdebug, don't bother with the rest of the interview and just hire them. ;)
Input sanitization
This is important. You can start with a discussion on why it's important and then ask for the most common methods to achieve it. This discussion will help you on what to ask.
Some hints:
You can find a lot of PHP snafus in this excellent discussion. If you are interviewing for a senior position you should definetaly ask on some of those. Some examples:
PHP's handling of numeric values in strings:
Need I say more?
Conclusion
A good PHP developer should combine a variety of skills & talents:
- What PHP-specific questions would you ask in a job interview?
- PHP job interview questions?
- PHP Interview questions
Code
- Ask the candidate to write code
- Ask the candidate to read code
- The code is non trivial but small
- You allow access to the manual and the internet
- The code has some trivial errors
- The code has some non trivial errors
- The code works fine, but it can be easily optimized
Resources
Ask for a detailed list of PHP resources the candidate uses. Books, blogs, forums, magazines, etc. That's how my current employers found out about StackOverflow.
If the candidate mentions StackOverflow or Programmers, you should NOT ask or try to find out their username. If they wanted to advertise their reputation they would have included a Careers 2.0 link on their resume.
Frameworks
Every PHP developer should know of the most popular PHP frameworks:
and be fluent in at least one of them. You can have a few code samples ready for each one and ask the candidate to read and explain them, after they tell you which one they are more familiar with.
Debugging & Profiling
I've always felt that PHP developers are lacking debugging and profiling skills (perhaps only the PHP developers I've worked with). If during the discussion you find out that the candidate actively uses xdebug, don't bother with the rest of the interview and just hire them. ;)
Input sanitization
This is important. You can start with a discussion on why it's important and then ask for the most common methods to achieve it. This discussion will help you on what to ask.
Some hints:
- mysqli_real_escape_string is good
- magic quotes are bad
You can find a lot of PHP snafus in this excellent discussion. If you are interviewing for a senior position you should definetaly ask on some of those. Some examples:
PHP's handling of numeric values in strings:
"01a4" != "001a4" // true
"01e4" == "001e4" // also true
Valid PHP code:System.out.print("hello");
In PHP, a string is as good as a function pointer: $x = "foo";
function foo(){ echo "wtf"; }
$x(); # "wtf"
Unit testingNeed I say more?
Conclusion
A good PHP developer should combine a variety of skills & talents:
- A good understanding of HTTP
- A good understanding of Apache configuration (Even if you use a different web server at your company)
- At least a basic understanding of JavaScript
- A great understanding of HTML / CSS