Professional PHP Community Marketing Expert Interview Preparation Guide
Download PDF

PHP Community Marketing Expert based Frequently Asked Questions by expert members with experience as PHP Community Marketing Expert. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts

61 PHP Community Marketing Expert Questions and Answers:

Table of Contents:

Professional  PHP Community Marketing Expert Job Interview Questions and Answers
Professional PHP Community Marketing Expert Job Interview Questions and Answers

2 :: Explain what are PSRs? Choose 1 and briefly describe it?

PSRs are PHP Standards Recommendations that aim at standardising common aspects of PHP Development.

An example of a PSR is PSR-2, which is a coding style guide. More info on PSR-2 here.

3 :: Tell me can the value of a constant change during the script’s execution?

No, the value of a constant cannot be changed once it’s declared during the PHP execution.

4 :: Explain me what is the w3c?

Standards compliance in web development is where everything is (hopefully?) going. Don't ask them to recite the w3c's mission statement or anything, but they should at least have a general idea of who they are.

5 :: Tell me what Kind of Things have you Done on the Social Side?

A pretty broad question as there are no right or wrong answers. Its more about what works. This question is purposely open ended as I just want to know what the interviewee has worked on in the past. The answer, for me is not based on how well you know Facebook and Twitter, but simply given the opportunity, do you have enough knowledge to be able to leverage social platforms to achieve a particular goal.

6 :: Do you know what are Traits?

Traits are a mechanism that allows you to create reusable code in languages like PHP where multiple inheritance is not supported. A Trait cannot be instantiated on its own.

It’s important that a developer know the powerful features of the language (s)he is working on, and Trait is one of such features.

7 :: Explain do you use Composer? If yes, what benefits have you found in it?

A: Using Composer is a tool for dependency management. You are able to declare the libraries your product relies on and Composer will manage the installation and updating of the libraries. The benefit is a consistent way of managing the libraries you depend on and you will spend less time managing the libraries you depend on in your project.

8 :: Explain briefly about a Search-friendly Site Looks Like?

Pretty basic I know, but I'm looking to find out whether or not the applicant has updated what he or she knows about on-site optimisation. Keyword research, title tags, urls, content, alt tags, site structure, navigation, internal linking, site maps, subdomains are all part of what I'm expecting to hear. However, what I don't what to hear is:

☛ Google can't crawl javaScript
☛ Google can't follow JavaScript links
☛ Keyword density must be X percent
☛ Google can't read Ajax
☛ Meta keywords are very important and should spend time including them
☛ Meta descriptions are not so important

If I'm still hearing this kind of things in 2012 it is most likely they may not be right for the top job.

9 :: Explain what is Memcache?

Memcache is a technology that caches objects in memory such that your web application can get to them really fast. It is used by sites such as Digg.com, Facebook.com and NowPublic.com and is widely recognized as an essential ingredient in scaling any LAMP.

10 :: Do you know what is Zend Engine?

☛ Zend Engine is used internally by PHP as a compiler and runtime engine. PHP Scripts are loaded into memory and compiled into Zend opcodes.
☛ These opcodes are executed and the HTML generated is sent to the client.
☛ The Zend Engine provides memory and resource management, and other standard services for the PHP language. Its performance, reliability and extensibility played a significant role in PHP’s increasing popularity.

11 :: Tell me what are SQL Injections, how do you prevent them and what are the best practices?

SQL injections are a method to alter a query in a SQL statement send to the database server. That modified query then might leak information like username/password combinations and can help the intruder to further compromise the server.

To prevent SQL injections, one should always check & escape all user input. In PHP, this is easily forgotten due to the easy access to $_GET & $_POST, and is often forgotten by inexperienced developers. But there are also many other ways that users can manipulate variables used in a SQL query through cookies or even uploaded files (filenames). The only real protection is to use prepared statements everywhere consistently.

Do not use any of the mysql_* functions which have been deprecated since PHP 5.5 ,but rather use PDO, as it allows you to use other servers than MySQL out of the box. mysqli_* are still an option, but there is no real reason nowadays not to use PDO, ODBC or DBA to get real abstraction. Ideally you want to use Doctrine or Propel to get rid of writing SQL queries all together and use object-relational mapping which binds your rows from the database to objects in your application.

12 :: Tell us what skills and technologies are you the most interested in improving upon or learning?

Find out if their future interests match the direction of the position (or the company in general).

13 :: Explain me soundex() and metaphone()?

soundex()
The soundex() function calculates the soundex key of a string. A soundex key is a four character long alphanumeric strings that represents English pronunciation of a word. The soundex() function can be used for spelling applications.
<?php
$str= “hello”;
Echo soundex($str);
?>
metaphone()
the metaphone() function calculates the metaphone key of a string. A metaphone key represents how a string sounds if pronounced by an English person. This function can also be used for spelling applications.
<?php
echo metaphone(“world”);
?>

14 :: Tell me what are the __construct() and __destruct() methods in a PHP class?

All objects in PHP have Constructor and Destructor methods built-in. The Constructor method is called immediately after a new instance of the class is being created, and it’s used to initialize class properties. The Destructor method takes no parameters.

Understanding these two in PHP means that the candidate knows the very basics of OOP in PHP.

15 :: Tell me what sized websites have you worked on in the past?

Find a developer that has experience similar in size to the project you're putting together. Developers with high traffic, large scale site expertise may offer skills that smaller-sized developers don't, such as fine tuning apache or optimizing heavily hit SQL queries. On the other hand, developers who typically build smaller sites may have an eye for things that large scale developers don't, such as offering a greater level of visual creativity.

16 :: Explain me what SEO Tools do you Use?

Finally, I always ask what tools they have used in the past. Generally speaking, I would expect a combination of OSE, Majestic SEO and Ahrefs for link analysis. Either Screaming Frog or Xenu for architecture diagnostics and AWR would normally come out top for rank analysis. And of course, Google Analytics the most likely tool for traffic monitoring.

17 :: Explain what are some new features introduced in PHP7?

1. Zend Engine 3 performance improvements and 64-bit integer support on Windows
2. uniform variable syntax AST-based compilation process
3. added Closure::call()
4. bitwise shift consistency across platforms
5. (null coalesce) operator
6. Unicode codepoint escape syntax
7. return type declarations
8. and scalar type (integer, float, string and boolean) declarations.

18 :: How to implement a class named Dragonball. This class must have an attribute named ballCount (which starts from 0) and a method iFoundaBall. When iFoundaBall is called, ballCount is increased by one. If the value of ballCount is equal to seven, then the message You can ask your wish is printed, and ballCount is reset to 0. How would you implement this class?

<?php
class dragonBall{
private $ballCount;

public function __construct(){
$this->ballCount=0;
}

public function iFoundaBall(){
$this->ballCount++;
if($this->ballCount===7){
echo "You can ask for your wish.";
$this->ballCount=0;
}
}
}
?>
This question will evaluate a candidate’s knowledge about OOP.

19 :: Do you know how to enable error reporting in PHP?

Check if “display_errors” is equal “on” in the php.ini or declare “ini_set('display_errors', 1)” in your script.
Then, include “error_reporting(E_ALL)” in your code to display all types of error messages during the script execution.

Enabling error messages is very important especially during the debugging process as you can instantly get the exact line that is producing the error and you can see also if the script in general is behaving correctly.

20 :: Tell us who was your best boss and who was the worst?

I've learned from each boss I've had. From the good ones I learnt what to do, from the challenging ones - what not to do.
Early in my career, I had a mentor who helped me a great deal, we still stay in touch. I've honestly learned something from each boss I've had.

21 :: Tell me what industry sites and blogs do you read regularly?

This question can give you an idea of how in-tune they are with the latest industry trends and technologies, as well as how passionate they are about webdev. It'll help separate the people who do it as a career AS WELL as a hobby from those who might simply be in it for the big developer paychecks.

22 :: Tell me what is htaccess? Why do we use this and where?

☛ htaccess files are configuration files of Apache Server that provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.
☛ These .htaccess files are used to change the functionality and features of Apache web server.
For instance, htaccess file is used for url rewrite.
–> It is used to make the site password protected.
–> .htaccess file can restrict some ip addresses so that on restricted ip addresses, the site will not open.

23 :: Explain why would we use === instead of ==?

If you would want to check for a certain type, like an integer or boolean, the === will do that exactly like one would expect from a strongly typed language, while == would convert the data temporarily and try to match both operand’s types. The identity operator (===) also performs better as a result of not having to deal with type conversion. Especially when checking variables for true/false you want to avoid using == as this would also take into account 0/1 or other similar representation.

24 :: Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "The email cannot be empty" in this case?

<?php
if(empty($_POST['email'])){
echo "The email cannot be empty";
}
?>
In this question, you will be evaluated on your knowledge about forms management and validation. There is not unique answer for this question, but it must be similar to this one.

25 :: Tell me what is the difference between GET and POST?

☛ GET displays the submitted data as part of the URL, during POST this information is not shown as it’s encoded in the request.
☛ GET can handle a maximum of 2048 characters, POST has no such restrictions.
☛ GET allows only ASCII data, POST has no restrictions, binary data are also allowed.
☛ Normally GET is used to retrieve data while POST to insert and update.

Understanding the fundamentals of the HTTP protocol is very important to have a good start as a PHP developer, and the differences between GET and POST are an essential part of it.
PHP Community Marketing Expert Interview Questions and Answers
61 PHP Community Marketing Expert Interview Questions and Answers