What is TDD & BDD and how do they differ?
Good responses = TDD stands for Test Driven Development, BDD stands for Behaviour Driven Development. TDD is a way to determine that small sections of code are returning the expected results by writing tests up front that that match the required outcomes. Examples of this are Unit Testing, Integration Testing and Behavioural Testing (Bonus points if PHPUnit Selenium, Mink or Codeception are mentioned). BDD focus on testing the business behaviour of the application regardless of the underlying code. BDD Tests generally test a user flow through an application, rather than sections of code. (Bonus points if Behat, Selenium, Cucumber, Gherkin, Codeception or PHPSpec are mentioned) …
What is PHPDoc and why would you use it?
Good response = PHPDOC is a standard for commenting PHP code. Generally you want to use it to explain to other developers what a section of code is doing, or how it works. (Bonus points if they mention how it can be used to generate technical documentation) …
For the design patterns you have experience with – what circumstances would you use them, and why
This you might need to explain the best pattern design you are confident with for example mention ORM and explain the need of it and how did you use it …
Explain what some of the concepts of S.O.L.I.D are?
Single Responsibility principle (Class should only have a single responsibility) Open/Closed principle (Open for extension, but closed for modification) Likskov Substitution Principle (Objects should be replaceable with instances of their subtimes without altering the outcome. Bonus points if they mention design by contract ) Interface Segregation principle (Many client specific interfaces are better than one general-purpose one) Dependency inversion principle (Depend upon abstractions, not concretions) …
What are the advantages of dependency injection?
ideal response should include; Testability Configurability Reusability …
What is a return-type declaration?
Return type declarations allow to specify what type of value is returned from a function. (Bonus points if strict typing is mentioned) …
What are some of the design patterns you have experience with?
Good responses = Singleton, Factory, Strategy, Front Controller, MVC (Model, View, Controller), Dependency Injection, Repository, ORM (Object Relationship Mapper), Observer, …
What is dependency Injection?
The ability to provide a component with its dependence either via construction injection, method calls or the setting of properties. …
What is a namespace, and how would you use it?
Namespaces are generally used to “group” sections of code with other related pieces of code, and can assist with code reusability. Namespaces prevent collision between different packages that have classes of the same name …
What is type declaration (also known as type hinting)
Good responses = A way to require parameters of functions to be of a certain type when called. (Bonus points if strict typing is mentioned) Type declaration ensures that parameters are always of the expected type. This reduces validation requirements for the developer. …