DEV Community

Cover image for Beginner-Level PHP Interview Questions

Beginner-Level PHP Interview Questions

Durgesh kumar prajapati on November 04, 2023

Let us now begin with the basic PHP interview questions and answers. 1. Who do we know as the father of PHP? Rasmus Lerdorf who created the langua...
Collapse
 
xwero profile image
david duymelinck

I guess recruiters stopped updating their php knowledge in 2020, see question 4.

Question 7 got me nostalgic. Where is the time I wrote php 4 code. What a wild time that was.

Please write a better post with more relevant information. And leave out the parts you shouldn't have copied (29, 39, 40, 51)

Collapse
 
lexiebkm profile image
Alexander B.K.

"54. What is overloading and overriding in PHP?"

From what I know, overloading in PHP is different than the one in other OOP languages like C++, Java and C#.
In PHP, it is used for dynamically creating properties and methods. These dynamic entities are processed via magic methods such as __set(), __get() for properties and __call(), __callStatic() for methods.

Btw, no mention about class autoloading, esp with spl_autoload_register() function ?

Collapse
 
moopet profile image
Ben Sinclair

A lot of these (I got through 1, 2, 4, 5, and 6 before stopping counting), nobody needs to know - it's just not useful information or relevant to a job.

If someone asked me them in an interview, I'd ask them why they wanted to know, and when was the last time they used that information in the real world.

Collapse
 
nimmneun profile image
Stefan • Edited

I rarely ever conduct interviews, but if I ever ask you one of these questions, esp. the first half -> throw something at me xD
Ofc different requirements might require different approaches. But I assume we are talking about a junior role / candidates first job maybe.

I'm usually more curious about where they are in their journey e.g.

  • what they have built so far
  • what languages they've used (go, c...c#, java, php)
  • if they used any 3rd party libraries/packages or frameworks
  • what they liked about the language/package/framework and why they chose it over X
  • what difficulties they encountered and how/if they were able to overcome/solve those
  • did they follow or come up with conventions for their project(s) e.g. PSR-N, common best practices
  • did they collaborate with others on a project (e.g. college, school, hobby or OSS repo ...) and how did they go about it, including VCS, deployment etc.
  • do they know about/use strict types, type coercion, type safety in general
  • might sprinkle in some questions about architecture/patterns/principles, but without expecting anything

And I just go from there to get an idea about a candidate and the way they approach a given problem etc.

In other words, I want to figure out if they are 1) a fit for the teams 2) can grow into the job and how many weeks/months it'll roughly take for them to be productive and contribute in a meaningful manner.

Collapse
 
lpheller profile image
Lukas Heller

This is a joke right? If those questions are asked and used to determine qualities of a candidate - run!