Interview Qs for PHP Developers

Resolving stakeholder issues can turn an average PHP coder into an expert developer, according to Dallas-based Web developer and PHP aficionado Chris Cornutt. And he should know, as he’s worked with the open-source language (as well as the users who rely on it) for over 13 years.

Interview Qs“Nine-to-five coders only see a piece of the puzzle,” Cornutt said in an interview. “When you delve a little deeper to solve a user’s problem, you not only gain an in depth understanding of the language, you learn how to write tighter, more efficient code.”

Click here to find PHP developer jobs.

If you’re a knowledgeable PHP coder (and problem-solver), he added, that’ll come out by the way you respond to some typical interview questions:

How would you find a specific string of text in a batch of files?

  • What Most People Say: “That’s simple. I’d probably use something like opendir or readdir to loop though the files and ‘file_get_contents’ to get their content and look for a match.”
  • What You Should Say: “The textbook answer might be to use a brute-force ‘file_get_contents’ kind of method, but what if the files are really big? You’d want to search smaller chunks of files, not the whole file at once. Reading in the file bit by bit with something like fopen or fread, you can evaluate only parts of the file at a time. In fact, using this method you could short circuit the search and return as soon as you find a match, not even requiring a read of the full file.”
  • Why You Should Say It: Out-of-memory errors are some of the most common and hard-to-fix problems that PHP developers encounter in the course of their workday. A more experienced developer understands the limitations of the language and knows how to work around its shortcomings.

Describe an HTTP request from start to finish.

  • What Most People Say: “The request travels from the browser to the Web server and then to PHP.”
  • What You Should Say: “The browser submits an HTTP request message to the server using plain ASCII text. The first line of the request contains some basic information, but the header contains the major operating parameters of an HTTP transaction. Specially, the header defines things such as from, accept, user-agent, accept-encoding, accept-language, if-match, referrer, authorization, modifications and dates as well as pragma. An HTTP request has over 20 steps, would you like me to go through all of them?”
  • Why You Should Say It: Demonstrating a fundamental knowledge of the foundational building blocks of Web requests is important. Especially in things like REST APIs where the HTTP action (the “verb”) is a key component of the request.

Upload Your ResumeEmployers want candidates like you. Upload your resume. Show them you’re awesome.

Describe the most common PHP security issues.

  • What Most People Say: “I’m familiar with cross-site scripting (XSS) and SQL injection.”
  • What You Should Say: “I’m familiar with dozens of issues including source code revelation, remote file inclusion, session hijacking, cross site request forgery (CSRF) and directory traversal. New issues come up all the time, so I monitor the top 10 list from the Open Web Application Security Project (OWASP) and follow the tips in their security cheat sheet for PHP developers.”
  • Why You Should Say It: An experienced developer takes security seriously, stays-up-to-date on the latest issues, and is committed to writing secure code. He or she demonstrates an understanding of the risks and how to fix/prevent the issues or where to go for help. Security is yet another piece of the puzzle and has to be balanced with other things—like speed, usability, etc.—when the work is decided on.

What is separation of concerns and how does it relate to MVC applications?

  • What Most People Say: “I’m not sure.”
  • What You Should Say: “Separation of concerns is a way to build layered applications and a key component of object-oriented architecture. It breaks an app down into distinct features based on functionality, making it easy for multiple development teams to work simultaneously or change existing code. The MVC design pattern encourages separation of concerns by assigning objects in an application one of three roles: model, view or controller. Some of the benefits of MVC include clarity of design, ease of growth and the ability to create multiple interfaces using the same data.”
  • Why You Should Say It: Well-structured applications provide separation of concerns because it creates scalability, multiple views and powerful user interfaces. Proficient developers have a base understanding of object-oriented architecture and know how to use the concepts to create robust, flexible applications that support diverse users today and in the future.

Related Articles