Hiring the right PHP web developer is an important task for a company looking to grow their web presence. If you’re in the process of trying to find the right PHP developer, or if you are a PHP web developer looking for a job, preparing the right interview questions can help you. A PHP developer typically works on the front end or back end processes of a web system. Though some web developers have some design skills, you are more likely to find a talented PHP developer who can develop great code, but not necessarily great designs. Our sample PHP developer interview questions are focused on finding a talented PHP developer.
If you’re looking for a job as a PHP web developer, reviewing these questions can help you prepare for the interview.
These are just example questions, you likely will not use them all in an interview, but they can be used to help understand the level of the developer you’re interviewing and whether or not he/she will be the right fit in your organization.
PHP Web Developer Interview Questions
We’ve organized the questions into several categories to help you prepare for the interview.
General Web Industry Questions
These questions are used to measure the candidate’s understanding of the web in general and give you an idea of how they keep up to date on industry trends.
- What do you do offline to learn about your work online?
- What industry blogs do you enjoy reading?
- Do you prefer working on a team or alone?
- How would you rate your level of expertise in a shell environment?
- Can you show me some of the code you have written in the past?
- What is your favorite programming language? Why?
- What web browser do you use?
- Do you have your own personal site? What is it? What’s the purpose of your site?
- Have you ever worked on an open source project? Was your code accepted into the project?
- What’s the largest website you’ve worked on? What specifically did you code on that site?
- How did you get into PHP?
- What is a cookie and what do you use it for?
- How does a cookie differ from a session variable?
- If you run into a problem while coding, how do you find a solution?
- What is XML? When do you use it?
- What is LAMP?
- Is PHP an old language? Should we be using .NET instead? Why? Why not?
- What is HipHop for PHP?
- What is the largest site on the Internet running on PHP?
- Outside of PHP, what web development areas do you believe you are most strong in?
- How do you connect to a remote Linux server?
- If your Apache web server is serving pages slowly, how would you troubleshoot the problem?
PHP Technical Questions
The bulk of your interview will be focused on these questions. These are the in-depth technical PHP questions you will use to identify the right candidate. Even if you are not proficient in PHP itself, you will learn a lot based on how well a candidate answers these questions.
- Have you ever used a PHP framework? What’s your favorite? What are the major differences between the major PHP frameworks?
- You’re receiving an error when uploading a file that the limit is set too low. Where would you change the setting to allow for larger file uploads?
- (Give the candidate some broken source code) Fix this code please.
- What features would you add to PHP if you could?
- What is the different between include and require?
- How and when would you use endif to end a conditional statement?
- Under what circumstances would you use === in a conditional statement?
- Explain what the ternary conditional operator is.
- What is an array?
- How would you combine two variables together into a new variable?
- When would you use Get versus Post? What are the major differences between the two?
- How would you access information sent via Post? Get?
- How do you encrypt data using PHP?
- Describe your experiences with web services.
- If I told you I needed data from a web service, would you prefer it in XML or JSON?
- In general terms, describe how you would extract data from a web service if it returns JSON?
- What is a regular expression? How do you use regular expressions in PHP development?
- How many times can you include a php file in another php file?
- How do you send email in PHP?
- How do you increase the maximum script execution time for PHP?
- How would you sort an array in PHP?
- What do we uses classes for in PHP? In what cases would you define a class?
- What’s the difference between echo and printf?
- How do you calculate the number of days between two dates in PHP?
- When I open up a web site you developed and its a blank white screen, what steps do you take to troubleshoot the problem?
- How would you redirect a page in PHP?
- What is ob_start(); used for? Why would you use it when developing web pages?
- How do you define a constant in PHP?
- How do you determine if a constant is defined in PHP?
- What is the difference between <? ?> and <?php ?>?
Though your candidate may only do PHP development, he/she still needs to understand HTML and CSS well enough to produce a good looking product.
- Are you comfortable coding HTML by hand?
- Can you write table-less code using CSS?
- If you are presenting an error message and want the text colored red, how would you achieve this?
- How would you hide content on a page? How would you show hidden content later?
- What does float left do? How would you clear a float?
- What browser is the most difficult to write good, clean code for? What are the major problems with this browser?
- What is an inline style? When would you use it?
- What width should you develop a web page for?
- What tools do you use to ensure your code passes w3c compliance?
- How do you submit a form without user interaction?
- What is Ajax?
- Describe code you have written which uses Ajax. Why did you use Ajax? How did you implement it? Why did you write it with Ajax in mind?
- What is jQuery?
- How would you animate an object on the page?
- What is the DOM?
Most PHP systems which require a database rely on MySQL. These questions are focused on MySQL and databases.
- How would you fix a corrupt table in a database?
- What is a primary key?
- What is an inner join? Left join? Right join? How are they different?
- Write a simple query for me to query all of the columns in a particular table.
- You have two tables which are connected via a unique ID. Write a query which will query both tables based on that unique ID.
- You have a table with an unknown number of records. You want to delete half of the records. You don’t care which records are deleted. What’s the most efficient way to do it?
- How would you create a new table in MySQL?
- What is a stored procedure? When would you use a stored procedure? Have you ever written a stored procedure?
- What is the difference between GROUP BY and ORDER BY?
- What is UNIQUE used for?
- What is DISTINCT used for?
- What is a temporary table?
- How would you select data into a temporary table?
- How do you delete records in MySQL?
- What is an alias? What would you use it for?
- How do you encrypt data in MySQL?
- What is a table index? Why would you use it?
What Questions Would You Add?
There are a number of things we could have asked to find the right PHP web developer. What questions did we miss? What would you ask? What have you been asked? Answer in the comments below.