Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've got a job interview a few days from today (and yeah, I'm dreading it). The job is based in PHP web development.

I have 3 years experience with PHP and a few other languages, but I'm only 17 so this is my first computer/programming related interview I've ever had.

To be honest, it's not like a huge organization/company so I don't think the interviewer(s) expectations are going to be too high (right?)..

The employer did mention on the phone that I will be asked to write some code in the interview.

I've had a look around and came across the famous FizzBuzz question, which I found quite easy to do.

I'm really nervous about this interview and don't want to mess it up. Can anyone give me some example questions that you would ask a PHP programmer, in an interview. Or even better, if you've been in the same situation, what kind of task(s) were you set?

share|improve this question

closed as not constructive by FrustratedWithFormsDesigner, Jarrod Roberson, Bernard, gnat, Walter May 29 '12 at 13:58

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

It varies widely. I recently interviewed for a PHP position and there was no coding (not even in the technical interview) but they had a few database diagrams they wanted me to decipher and describe, and suggest how it would be changed for new features. If you really want questions, I googled "PHP interview questions" and found this: phpinterviewquestions.com –  FrustratedWithFormsDesigner May 28 '12 at 21:39
@FrustratedWithFormsDesigner Right! Thanks for the link. Could you give an example question of what you was asked regarding the "database diagrams"? Thanks man xD –  navnav May 28 '12 at 21:51
Why the downvote? –  navnav May 28 '12 at 22:17
Maybe some would feel like you want to get your "homework" done? –  dukeofgaming May 29 '12 at 0:56
One I was asked was how to create a simple secure login page. The interviewer said he was always amazed at how many people flubbed that question. –  jfrankcarr May 29 '12 at 11:12

2 Answers 2

up vote 4 down vote accepted

When I interview people, I keep the coding simple. Something like 'write a program to output a 10x10 multiplication table', show me the syntax mistakes in this (awfully written) code', 'Explain what this (obvious design pattern) code does and what's good and bad about it' etc. The aim is twofold: filter out people who can't write or understand basic code (we do actually get some), and provide a talking point for finding out how they think and approach problems. I tend to avoid very specific and/or difficult coding challenges as it can over-emphasise prior experience of that particular problem and we might end up going for the one person who happens to have had a similar question in a previous interview, but who's not a good learner. Being able to talk widely around a simple scenario is a pretty good indicator of experience, curiosity and communication skills.

I'd be looking for things like the following to emerge from the discussion:

  • Awareness of more than one way to solve the problem e.g. for, foreach, while.
  • Understanding of other issues that would impact on the solution e.g.
    • is this a HTML multiplication table, or are we sending results via AJAX as JSON or XML?
    • Maybe we need to separate presentation from business logic.
    • What if we want to vary the size of the table in future?
    • How can this code be unit tested? Why would we want to?
    • What steps can be taken to make it robust in the face of inevitable future changes in requirements?
  • Knowing why design patterns are used, being able to explain what good OOP principles are encoded in them e.g. separation of concerns, loose coupling, polymorphism, etc. What happens if these principles are not stuck to.

Ideally, these issues will emerge quickly in discussions, with the candidate pointing them out. If not, I'll prompt them and see where things go, so I'd say to expect questions that are open ended, or at least designed to allow you to elaborate and show your skills. Try to keep on-topic in your answers, but show a broader knowledge than just the average person.

Having said all that, we have a lot of diverse projects, so we want flexible generalists. Maybe if the jobs you are going for are very specific to using a particular system or domain, you will find more specific code-based problems.

share|improve this answer

Personally, I'd formulate tasks that have to do with:

Object-oriented questions

If I were to hire a PHP developer I'd expect lots of script-kiddies and spaghetti-coders. I'd look for a good candidate to be able know what PHP is capable of doing from an object oriented perspective.


A simple but essential architecture pattern used in most modern php web frameworks such as Symfony.

MVC framework experience

Code Igniter, Kohana, Symfony, Symfony 2, Zend or whichever other. At least know about them (and know the previous two points).

Javascript and ajax

Modern web applications rarely rely only on server-side only code. Javascript frameworks like MooTools let you do ajax extremely easy.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.