Interview questions… for a PHP job

Last week I went through one and a half hellish days of interviewing candidates for my replacement – one position for PHP and another for the research coordinating. Larry and I talked to over a dozen people. It wasn’t bad, per-se, but I wouldn’t do so many all at once again. It really made me realize how the whole interviewing process must run like a well-oiled machine so it won’t kill you in the process!

We didn’t have a lot of people apply for the PHP job, but it was a good experience for me nonetheless. I gave each person 6 questions to answer as part of the interview so I could gauge where they’re at:

  1. What does nl2br() do?
  2. Tell me about explode()
  3. What can you tell me about this (My)SQL query:

    $sql=”SELECT * FROM users WHERE uname='{$_POST[‘uname’]}’ AND password='{$_POST[‘password’]}'”;

  4. What does this function do? mysql_real_escape_string()
  5. This is a MySQL thing, what is it: FULLTEXT
  6. (Showing an unlabeled illustration of the CSS box model) Please label this CSS box model

Nobody got all of them right, but it was clear who knew what they were doing, and who didn’t. Everyone got FULLTEXT wrong, thinking it was the TEXT or LONGTEXT data type. Understandable if you haven’t played around with the MATCH… AGAINST… queries before (popular for creating your own searches on your site). Only one person recognized a potential error in the database query: yes, it’s vulnerable to SQL injection attacks, which lead right into the next question about mysql_real_escape_string(). If they missed the query problem, they usually missed the escaping question… which lead me to give them a free 2-minute lesson on security. The CSS box model was sort-of hit and miss. Most of them knew at least a little bit to explain some kind of difference between the margin and padding. Others were either dead-on or very close (maybe a minor mistake?). nl2br() was also hit and miss. Funny, because that should be one of the first functions you become really familiar with when learning PHP.

So those were my questions. We ended up hiring a really bright sophomore from the Computer Science department. I think this job will be a really good learning experience for him, and hopefully provide him with the same outcome as I had – becoming proficient enough to get hired off by industry. Of course, he may choose to stay, and he’d be a good man just as well.




1 Comment

Leave a Reply