views:

1144

answers:

7

Hello There,

What tricky questions can you suggest to ask an interviewee about PHP?

I suspect there can be much to be asked from micro-optimization tips and probably questions related to dealing with deep nested arrays.

Let's suppose, we are looking for a good php developer. What can be the trickiest questions to ask him?

Thanks for your suggestions.

+3  A: 

I did several technical PHP interviews as the interviewer (i.e. the one asking questions), and I never quite cared about micro-optimizations : I always care more about the general picture.

If a candidate thinks more about single-quotes versus double-quotes than he does about MVC, code-reuse, frameworks, (automated, for an experienced developper) testing, continuous integration, ... then, I quite worry... And I don't consider him as a "good PHP developer".

Pascal MARTIN
+11  A: 

Tricky questions aren't useful when interviewing in my opinion.

If you want to find someone who is smart and gets things done, you should do two things:

  1. Ask him/her a basic question that will prove they know how to program. Something like the "fizzbuzz" question that Atwood posted about (http://www.codinghorror.com/blog/archives/000781.html).

  2. Drill them about their experience. Ask them probing questions about their work in other applications they have written. Detailed questions. Things like "why did you choose this approach over this approach".

Doing "hey, I'm smarter than you" interviews will not hire good people. It will hire people capable of recognizing trick questions, which is interesting but not necessarily an every day skill required to produce code.

Anderson Imes
+6  A: 

"Good" and "tricky" are about as opposite as it gets when it comes to interview questions. The goal when interviewing programmers isn't to figure out who happened to read about this really weird thing that happens in this one weird edge case 0.01% of the time on PHP version X.Y.Z - the goal is to find people who can competently write useful software.

What you want are questions that both allow and encourage the interviewee to talk through their thoughts - questions that are open-ended enough that it's not just a "here's the answer in three words, what next?" but at the same time give enough direction that you don't just get a noncommittal answer.

These kind of questions allow you to actually get a feel for whether this is someone you'd trust writing code with, as opposed to someone who knows some trivia but either wouldn't get along well with your team's development style, or just couldn't keep up (in productivity or quality) in the first place.

Amber
+4  A: 

Don't ask "tricky" questions in interviews.

  • Interviewees tend to be nervous, so don't always answer tricky questions well, even if they know the answer. Under these conditions, even "simple" questions will trip people up.

  • Good programmers are the ones who can work through a problem efficiently using clear logic to arrive at an effective solution. Encyclopaedic knowledge is useful, but doesn't tell you at all if a programmer is good or not. Indeed, a good and experienced C++ programmer who doesn't know any PHP may turn out to be a better candidate than a dedicated PHP programmer. Ask leading questions that allow you to explore problem solving ability, not "do you know a piece of obtuse information".

  • Most people who you interview should already have passed a lot of the technical side of things (their CV & experience). You're interviewing them to confrim that they're not lying on their CV, to dig deeper into specific areas of ingterest than are covered by the CV, and to determine if they seem to have the experience and personality that will fit well into your team. So don't just look for tricky questions - look at the wider picture. How someone answers a question is often more useful than what their answer is.

Jason Williams
+15  A: 

I'm not a frequent PHP developer, but the issues below should be answerable by any decent PHP developer and good developers should be able to answer them for their preferred web stacks.

Security:

  1. How do you prevent SQL injection attacks in PHP? What if you are dealing with a PHP 4 legacy app?
  2. What are some mechanisms for preventing cross-site scripting attacks?
  3. What compromises have you had to make between ideal security and user convenience? Hint: the answer is not "none."
  4. What's the best way to store password information in a database?
  5. What are some methods to defend against spambots? Which ones are least burdensome on users? What options adequately support disabled users?

Performance:

  1. How do you decide what to optimize?
  2. How do you identify performance bottlenecks in an application?
  3. What are the options for caching in PHP?
  4. What are the tradeoffs for the available caching mechanisms in PHP?
  5. When your database access code turns out to be the bottleneck, what can you do to improve things?
JasonTrue
+1. I wish you could mark favourite answers. I love good interview questions. May borrow in the future ;)
zombat
can u post the expected answers for these questions...........
RSK
A: 

I'd stay away from trying to tricky questions. PHP is a training wheels language(not much to mess up), the trick to finding a good candidate is seeing how the programmer works. Does he cut corners? Does he test code well? Is his documentation up to par? A code sample might be the best way, or just some basic code test.

If you want to trick them XML parsing questions are always a PITA or DomDocument.

Logan Bailey
A: 

HI.. Any Interviewer wants his Interviewee to have practical implementation knowledge regarding PHP coding.. Best example would be - He may ask questions on the problems that you may encounter while doing a php coding. So, the best way to prepare for a php Interview is to study the PHP handbook by WROX publications and do some PHP projects..

Noddy Cha