PHP developer interview questions

Even if the interviewer doesn't know the answers to these questions, they could probably get a good idea for a job candidate's comfort with the material from how much they stutter and squirm after each question.

General

  1. What are the current versions of Apache, PHP, and MySQL?
  2. What is a cookie and how is it useful?
  3. If you run into a problem while coding, what steps do you take to find the answer?
  4. What files are commonly found in these standard UNIX directories?
  5. /bin
    /boot
    /dev
    /etc
    /home
    /mnt
    /tmp
    /var

HTML

  1. When you want to show some part of a text displayed on an HTML page in red font color, what different possibilities are there to do this? What are the advantages and disadvantages of these methods?
  2. What's the difference between and

CSS

  1. What is the primary advantage of CSS?
  2. Describe the different ways to have content initially hidden on a page?
  3. Explain the purpose and implementation of a float?
  4. Describe the inherent CSS differences between IE and Mozilla.

Javascript

  1. How can we submit a form without a submit button?
  2. Do you use DHTML and Javascript? Describe the projects you've used them in.
  3. Describe some methods to redirect a page in Javascript and PHP.

PHP

  1. What is the difference between $message and $$message?
  2. What are the differences between PHP3, PHP4, and PHP5?
  3. How can I execute a PHP script using the command line?
  4. How can we increase the execution time of a PHP script?
  5. What are public, private, protected, and static methods?
  6. What is an abstract class and interface?
  7. What is meant by urlencode and urldecode?
  8. How do you set a session variable?
  9. How do you set a cookie? How about reading the value within the same page execution?
  10. What are two different ways of unsetting a cookie on the user's machine?
  11. How do you encrypt data using PHP?
  12. What is the difference between an enumerated array and an associative/hashed array?
  13. What are the differences between require, include, and include_once?
  14. How do you increase the allowable execution time of any PHP script?
  15. What will this output?
    <?php
    $a
    = false;
    $b = true;
    $c = false;

    if (
    $a ? $b : $c) {
       echo
    'false';
    } else {
       echo
    'true';
    }
    ?>

  16. What will this output?
    <?php
    $txt_var1
    = "PHP";
    $txt_var2 = &$txt_str1;
    $txt_var2 = "MySQL";

    echo
    $txt_var1 . $txt_var2;
    ?>

  17. What does this do?
    <?php
    if (isset($_REQUEST))
    while(list(
    $varname, $varvalue) = each($_REQUEST)) { $$varname = $variable; }
    ?>

MySQL

  1. How can we repair a MySQL table?
  2. A select query over a large table runs very slow because of the growing number of entries in a table. What different measures could be taken to improve speed?
  3. What are different types of tables in MySQL and their differences.
  4. What is the difference between GROUP BY and ORDER BY in SQL?
  5. How do you encrypt data present in a MySQL table using MySQL?
  6. What is an EXPLAIN? What does its result look like?
  7. What is an alias? What elements can be aliased and how would one do so?
  8. What are 3 different methods of adding data to a table?
  9. What is the difference between "DELETE FROM [...]" and "TRUNCATE TABLE [...]"?

Misc

Elaborate on the following acronyms:

LAMP
SNMP
ODBC
IMAP
TCP
PHP
SQL
ASP
SSL
API
XML
XSLT
XHTML
AJAX
JSON
SOAP
JAVA

» deekayen's blog · Delicious · Digg · Technorati Topics:

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <hr /> <a> <p> <em> <strong> <cite> <code> <blockquote> <ul> <ol> <li> <dl> <dt> <dd> <div> <img> <h1> <h2> <h3> <h4> <h5>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options