This has an anonymised source, as I have lost the origin of the questions. I wrote this in 2011 (I think) with little reference to the internet or books, thats why it has no references section.

  1. What do you think are the key benefits of using PHP and MySQL in a business systems development stack?
    1. In terms of development, PHP and MySQL are good tools for dynamic data-driven business systems as they reduce TCO of your business unit. Due to the licencing terms attached to these products one may build high quality software without being constrained to assist the profit margins of third parties. Both these products are designed to run on a wide variety of computing platforms; so one may have homogeneity and lower administration costs. As they both follow an opensource philosophy you are dependant on a known quality product. Both tools have good market integration, in that one may get pre-existing tools to supply additional functionality.
  2. What are the main improvements in how OOP is implemented in PHP5 over PHP4?
    1. PHP5 supports proper constructors and destructors. Unless you are careful, references in PHP4 generate memory leaks. PHP5 provides data visibility operators, interfaces, cloning and as of 5.3 namespace support. The more recent editions are frequently used with third party API such as Zend framework2 which provide infrastructure.
  3. Describe the purpose of the keyword UNION:
    1. In MySQL a union is a keyword to treat fields in different tables or subqueries as part of the same row when building resultsets. This allows highly normalised databases to have simpler outputs. It needs to be used carefully or there are performance issues.
  4. What piece of development undertaken during the last year are you most proud of and why?
    1. In the last twelve months, my best bit of PHP was the differencing algorithm I wrote to determine changes in table content or table structures. The algorithm took two tree structures and returned difference between them. The reason I liked it (although I can't demonstrate this to you), is the code was really specific purpose; but written properly, as a generic library. It was clean, readable and better structured than much of the inherited code I was handling at that point. For use as a dB update automation, the tool created update changeset, and a revert changeset. These where made by flipping the input data over, as it was properly written.
    2. To summarise, it was an artefact with stylistic integrity and purity of purpose. It was “modern” in the arts meaning of the term. I don't often get to write code like that.
  5. You've been told to develop a new customer tracking tool for the sales team. The requirements are rather thin on the ground - what steps do you take to ensure that you create the right tool for their needs?
    1. As this is an internal tool, staged releases are practical. Agile development would be necessary. I would build a very cheap “something like a solution” tool that did the minimum technology or time to create. I would attempt to watch the sales team use it, and discuss with them what they thought was missing. Getting people to tell you what is absent from a tool is easier than creating a context-free requirements list. I would amend a batch of things they thought most important. I would repeat until I had consumed all the budget, or they stopped noticing significant failures. I would get buy-in from management before spending any time, to ensure my continual interaction is seen as customer focus, rather than wasting time, or technical failure.
    2. Out side of simple web-tools, a paper interface prototype may be cheaper. HTML wireframes are very cheap to build.
  6. Exception handling was introduced in PHP5. Are exceptions relevant in web applications development?
    1. Exceptions are very useful for web applications. They allow all critical failure points to be reported via the same error handler. This leads to shorter and easier-to-update code (otherwise one needs to trigger the error reporter for each possible error point). Used like this Exceptions make it is easier to decouple code, for example logic classes never need to create or manipulate HTML to report errors. In practice Exceptions make it easier to have more precise error reporting, leading to better UI.
  7. In what context would you use the EXPLAIN command?
    1. The explain command is used to report on what indices and locks a query is using, and return data about the query, rather than the results of the query. I would use the explain command to get the above data, as my queries where too slow, and so to adjust the indices.