1. Explain me what are the main error types in PHP and how do they differ?

In PHP there are three main type of errors:
Notices – Simple, non-critical errors that are occurred during the script execution. An example of a Notice would be accessing an undefined variable.
Warnings – more important errors than Notices, however the scripts continue the execution. An example would be include() a file that does not exist.
Fatal – this type of error causes a termination of the script execution when it occurs. An example of a Fatal error would be accessing a property of a non-existent object or require() a non-existent file.

Understanding the error types is very important if you are new to programming because they help you understand what is going on during the development, and they will help you know what you should look for in the code during debugging.

2. Explain how we can get the number of elements in an array?

The count() function is used to return the number of elements in an array.

Understanding of arrays and array related helper functions it's a knowledge that every junior developer should have.

3. Explain me what are the 3 scope levels available in PHP and how would you define them?

Private – Visible only in its own class
Public – Visible to any other code accessing the class
Protected – Visible only to classes parent(s) and classes that extend the current class

This is important for any developer to know because it shows an understanding that building applications is more than just being able to write code. One must also have an understanding about privileges and accessibility of that code. There are times protected variables or methods are extremely important, and an understanding of scope is needed to protect the integrity of the data in your application along with provide a clear path through the code.

4. Tell me what does the following code output?

$i = 016;
echo $i / 2;?

The Output should be 7. The leading zero indicates an octal number in PHP, so the number evaluates to the decimal number 14 instead to decimal 16.

5. Explain what is smarty?

Smarty is a template engine written in PHP. Typically, these templates will include variables -like {$variable} - and a range of logical and loop operators to allow adaptability within of the template.

6. Do you know about the Latest Changes at Google?

In my opinion, a good candidate would have their ears to the ground in terms of what is going on at Google. Not every single update carries the same importance, so I definitely do not need a running commentary of everything that is written on Google webmaster blog.

However, whenever a major algo changes is announced, its effect on the web and your site should be taken notice of. Like I've mentioned before, I honestly don't expect to hear every tweak since Florida, but I want a detail idea of the current state of play. Recently it has been Penguin, Panda and EMDs and any good SEO should know these like they know their alphabet.

Panda - What does it do, what cause you to get hit by it, how do you mitigate against its effect, how do you recover?
Penguin - Why was it rolled out, what do you need to do, how do you recover?
EMDs downgrade - What is the history behind it, how would you future proof your client's site?

Personally, I expect details answers to such questions as the candidate will be in charge of handing down instructions to their team and also making recommendations to clients.

7. Explain what are a few of your favorite development tools and why?

If they say notepad you've obviously got the wrong person for the job. Not only can this help you gauge their level of competence, but it'll also see if they match the tools everyone else uses in-house.

8. Explain me what are a few personal web projects you've got going on?

Almost all developers have personal web projects they like to plug away at in their spare time. This is another question that can help differentiate the passionate developers from the clock-punchers. It's also a good question to end an interview with, as it's usually easy (and fun) for them to answer.

9. Tell me why do you think this industry would sustain your interest in the long haul?

What expectations or projects do you have for the business that would enable you to grow without necessarily advancing? What excites you about the business? What proof can you offer that your interest has already come from a deep curiosity-perhaps going back at least a few years-rather than a current whim you'll outgrow?
Sample Answer: The technology in the industry is changing so rapidly that I see lots of room for job enhancement regardless of promotions. I'm particularly interested in the many applications for multimedia as a training tool.

10. Do you know what's the difference between the include() and require() functions?

they both include a specific file but on require the process exits with a fatal error if the file can't be included, while include statement may still pass and jump to the next step in the execution.

Download Interview PDF

11. Tell me how would you declare a function that receives one parameter name hello?

If hello is true, then the function must print hello, but if the function doesn’t receive hello or hello is false the function must print bye.

function showMessage($hello=false){
echo ($hello)?'hello':'bye';
In this question, the interviewer can evaluate if the developer knows how to declare a function and how they would manage the fact of the parameter can or cannot be on the function call. The interviewer can also evaluate if the developer knows the if syntax and if they knows how to print text(echo function).

12. Tell me what are getters and setters and why are they important?

Getters and setters are methods used to declare or obtain the values of variables, usually private ones. They are important because it allows for a central location that is able to handle data prior to declaring it or returning it to the developer. Within a getter or setter you are able to consistently handle data that will eventually be passed into a variable or additional functions. An example of this would be a user's name. If you are not using a setter and just declaring the $userName variable by hand you could end up with results as such: "kevin", "KEVIN", "KeViN", "", etc. With a setter you can not only adjust the value, for example, ucfirst($userName), but you can also handle situations where the data is not valid such as the example where "" is passed. The same applies to a getter – when the data is being returned, you can modify the results to include strtoupper($userName) for proper formatting further up the chain.

This is important for any developer who is looking to enter a team-based / application development job to know. Getters and setters are often used when dealing with objects, especially ones that will end up in a database or other storage medium. Because PHP is commonly used to build web applications you will run across getters and setters in more advanced environments, even as a junior developer. They are extremely powerful yet not talked about very much. You can really impress an interviewer by knowing what they are and how to use them early on.

13. Tell me what PSR Standards do you follow? Why would you follow a PSR standard?

You should folow a PSR because coding standards often vary between developers and companies. This can cause issues when reviewing or fixing another developer's code and finding a code structure that is different from yours. A PSR standard can help streamline the expectations of how the code should look, thus cutting down confusion and in some cases syntax errors.

14. Explain me your Link Building Process?

I asked this to simply know the candidates understanding of the link building process. This question allowed me to get beyond the typical 'a link must be from relevant site'. You would expect this kind of answers interviewing an exec. What I was looking for was more to do with work load split, data recording, site evaluation and overall time management skills. Link building is a tedious task and it's important that as a senior SEO specialist you are aware that people in charge of this can easily become overwhelmed.

Even though not explicitly asked, a question like this also gives me key insight into how the candidate views link building. If all I'm hearing are directory submissions, blog commenting, page rank and exact matching anchors you're less likely to be called in for a second interview. I'm more interested in hearing about outreach campaigns, what you did to attract links in the past and content partnerships. I'm also interested in creative ideas used to build links.

I'm also big on strategy. Each campaign is different and for me, a one size fits all approach cannot give the best result. Therefore it is crucial that candidate put across that link building for an educational site is not the same for say, travel insurance.

15. Explain do you prefer to work alone or on a team?

This is an important question to ask depending on the work environment. If your project is going to require close interaction with other developers it's very handy to have someone who has had that kind of experience. On the other hand, many developers thrive while going solo. Try to find a developer that fits your needs.

16. Tell me what web browser do you use?

There is a right answer to this question: all of them. A competent developer should be familiar with testing cross-browser compatibility by using all the major web browsers. Obviously they'll have a primary browser they use for surfing, but their answer to this question might be a good way for you to segue to asking how extensively they test cross-browser issues. Also, if it's some kind of css/html position seeing what toolbars they have installed can be a good metric of their skillset (I personally find the web developer toolbar for firefox to be invaluable)

17. Tell me what are your aspirations beyond this job?

Again, don't fall into the trap of specifying job titles. Stick to a natural progression you see as plausible. How should this job grow for the good of the organization? Then turn your attention once again to the job at hand. If you seem too interested in what lies beyond this job, the interviewer will fear that you won't stick around for long.
Sample Answer: Beyond this job as a marketing assistant, I see myself moving up through marketing analysis into brand management and eventually running a category. I'm aware that there are several skills I need to develop in the interval, and I believe with your continuing-education program and my own motivation for self-improvement, I'll have those skills when the opportunities arise for greater responsibility. That's why I'm determined to learn from the ground up, starting as a marketing assistant.

18. Do you know how to get the IP address of the client?

This question might show an interview how playful and creative the candidate is because there are many options. $_SERVER["REMOTE_ADDR"]; is the easiest solution, but you can write x line scripts for this question.

19. Tell me can you extend a Final defined class?

No, you cannot extend a Final defined class. A Final class or method declaration prevents child class or method overriding.

20. Explain how does one prevent the following Warning ‘Warning: Cannot modify header information – headers already sent' and why does it occur in the first place?

Do not output anything to the browser before using code that modifies the HTTP headers. Once you call echo or any other code that clears the buffer you can no longer set cookies or headers. That is also true for error messages, so if an error happens before you use the header command and the INI directive display_errors is set then that will also cause that error to show.

21. Explain how can we increase the execution time of a PHP script?

☛ Default time allowed for the PHP scripts to execute is 30 secs mentioned in the php.ini file. The function used is set_time_limit(int sec). If the value passed is ‘0', it takes unlimited time. It should be noted that if the default timer is set to 30 sec, and 20 sec is specified in set_time_limit(), the script will run for 45 seconds.
☛ This time can be increased by modifying the max_execution_time in secs. The time must be changed keeping the environment of the server. This is because modifying the execution time will affect all the sites hosted by the server.
☛ The script execution time can be increased by
☛ Using sleep() function in PHP script
☛ Using set_time_limit() function
☛ The default limit is 30 seconds. The time limit can be set to zero to impose no time limit to pause.

22. Explain what is meant by PEAR in PHP?

PEAR is an acronym for “PHP Extension and Application Repository” The purpose of PEAR is to provide:
☛ A structured library of open-sourced code for PHP users
☛ A system for code distribution and package maintenance
☛ A standard style for writing code in PHP
☛ PHP Foundation Classes (PFC)
☛ PHP Extension Community Library (PECL)
☛ A website, mailing lists and download mirrors to support the PHP/PEAR community

23. Explain what Kind of Reports do you Give to your Clients?

I like numbers. So maybe I might be biased towards this question but for me, measuring things is very important. In SEO we are always having to justify our ROI and one of the ways you can prove it is through reporting. Generally speaking, once a candidate comes from an agency background I would expect reporting to be almost inbred as clients always want to justify their SEO spend. However, I'm interested in what metrics the applicant think are important across both search and social. I'm also keen on hearing how they usually present this data and the frequency at which is delivered.

24. why Do You Want To Work For Us Here?

It's rare for an interview not to include this question.
The good news is that it's an easy one to prepare for.
Most companies want to recruit people who are enthusiastic about the company and its products. They don't want people on the team who “ended up there by accident”. So this is your chance to show why working for the company is important to you and why you think you will fit in.

They will be looking for evidence that you can make a contribution and will be able to grow into the role they are recruiting.

This question is designed to screen out candidates who aren't serious about the company or may be using it as a stop-gap, while they look for something better.

It's also your chance to make the most of the company research you have done. You can use this opportunity to add comments that show you understand the company's position in the market place; the role of its competitors and any challenges it may be facing.
Sample Answer: “I'm not looking for just another pay check. I enjoy my work and am proud of my profession. Your company produces a superior product/provides a superior service. I share the values that make this possible, which should enable me to fit in and complement the team."

Download Interview PDF

25. Tell me what's the difference between unset() and unlink()?

unset() sets a variable to “undefined” while unlink() deletes a file we pass to it from the file system.