PHP Data Modeling Interview Questions

Questions to ask a PHP Developer

PHP engineers are often required to have a knowledge of the full web stack: starting with the ability to write optimized SQL queries, and wrapping up with a good understanding of HTML/CSS. When interviewing a PHP developer, make sure that you think through your requirements and ask good questions for all of them.

Here's a suggestion for a good menu of PHP interview questions:

  1. Start off with some basic SQL such as SQL Skills: Joins, Averages and Sums
  2. Include at least one simple coding task such as Separate a list of integers or Find the missing number
  3. Explore their ability to come up with an overall system design and data model with a flexible question like Design a restaurant reservation system or Design a card game system
  4. Ensure that they have a solid understanding of the basic building blocks of the web by asking about HTTP GET and POST or What are HTTP cookies?
  5. Wrap up with some CSS questions like Explore the HTML display and position attributes or CSS rule-set basics

Assume that you have access to an employee's email Inbox, and that you can parse the content of their emails, including the email headers.

  1. How can you use this to deduce their first-degree connections?
  2. What kind of heuristics can you come up with to quantify the strength of these first-degree connections?
  3. How can you use this to deduce their second-degree connections?
  4. How can you use this to deduce their third-degree connections?
  1. Describe how you would store a social graph in a relational database.
  2. Describe an efficient algorithm to determine whether or not person X is a 2nd degree connection of person Y.
  3. Describe an efficient algorithm to determine whether or not person X is a 3rd degree connection of person Y.
  4. How can you make #3 very quick. E.g. how does Linked In compute 3rd degree connections quickly?