PHP Technical Interview Questions Made My Me On My Own Hand To Crack The Interview(Part 1) (Part 2 Questions And Answers Will Be Released Very Soon)
PHP Technical Interview Questions Made My Me On My Own Hand To Crack The Interview In Initial Stage(Part 1) (Part 2 More And More PHP Questions And Answers Will Be Released Very Soon)
Hello Guys, Good Evening. How are you all? Hope you are all fine. So, guys welcome back once again to my blog to know about the PHP Technical Questions and answers Part 1 made by me. Part 2 PHP technical questions and answers will be released very soon.
Q1. What is Frontend and Backend?
Ans: Frontend development refers to the part of the application that the users directly interact with like User Interface(UI). For ex. : HTML, CSS, JavaScript and frameworks like React and Angular.
Backend development is the server - side infrastructure that handles data storage, processing and application logic. For ex. : PHP, Java, Python, C# and frameworks like Laravel and CodeIgniter.
Now coming to my next question.
Q2. What is query string in PHP?
So Guys, do you know what is query string in general? Ok, just let me explain it step by step along with example and small code.
Ans: Query String in PHP is the part of the URL that starts with the Question Mark (?). For ex. :
http://example.com/page.php?name=Ayan Bhattacharjee&age=28
Small Code =>
<?php
$name=$_REQUEST['name'];
$age=$_REQUEST['age'];
echo "Name: ".$name."<br>";
echo "Age: ".$age;
?>
Query String is passed by GET() Method so query string can be denoted as $_GET() Method or $_REQUEST() Method because $_REQUEST belongs to both $_GET() Method as well as $_REQUEST() Method, but you will never see that Query string is denoted as $_POST() method. The reason is very simple fanda that is Query String cannot be passed through POST() Method.
Q3. What is the full form of Ajax?
Ans: The full form of Ajax is Asynchronous javaScript And XML.
Q4. What is Ajax?
Ans: Ajax is a web development technique that allows the web pages to update their content without reloading the entire page.
Q5. Why do we use Ajax?
Ans: Ajax is used to make the web pages more interactive and responsive by allowing them to update the parts of their content without reloading the entire page.
Then you only see how much ajax is usefull. We even don't have to reload also. Every single parts of the data or details will get reflected in a single page itself without reloading the entire page.
Q6. What is Cookie?
Do you know that Cookie and Session as well as Cookie and Session difference is very very much important questions for interview. 99% of chance is their to ask either about What is Cookie? or What is Session? or What is the difference between Session and Cookies?
Ans: Cookie is a small file sent by the server to the client machine to trace how long ago the user has visited the website. Cookie is used to store the user information on client machine. Cookie is denoted by a super global variable $_COOKIE. For example : Remember Me. Cookie is known as a global carrier of data.
Q7. What is Session?
Ans: Session is also known as a global carrier of data and it trace the user activity on Website. Session is used to store the user information on server. Session is denoted by the super global variable $_SESSION. For example : Login, Logout, Multipart-Form.
Q8. What is the difference between session and cookie?
Ans: Session - Session is used to store the user information on server. Session is more secure. Session do not have any limit. For ex. : Login, Logout, Mutipart Form.
Cookies - Cookies is used to store the user information on client machine through web browser. Cookie is less secure. Cookie has 0-2048 data to store. For ex. : Remember Me.
Q9. What is the difference between GET() and POST() Method?
This is another very very important question for interview and it is also a commonly asked question PHP interview.
Ans: GET() Method - GET() Method is unsecure method and it can pass query string.
POST() Method - POST() Method is secure method and it cannot pass query string.
Q10.What is Inner Join, Left Join (Left Outer Join), Right Join (Right Outer Join), Full Join (Full Outer Join) and Cross Join?
This is another very very important question for interview and it is also a commonly asked question PHP interview.
Ans: Inner Join => Inner Join returns all records when there is matching values from both the tables.
Left Join (Left Outer Join) => Left Join (Left Outer Join) returns all records from left table, and the matching records from the right table.
Right Join (Right Outer Join) => Right Join (Right Outer join) returns all records from right table, and the matching records from left table.
Full Join (Full Outer Join) => Full Join (Full Outer Join) returns the matching values from either one of the tables, and if their is no matching values in any of the table then it returns false.
Cross Join => Cross Join returns all records from both the tables.
Q11. What is meant by constructor?
What is meant by __construct()? Explain with an example.
This is another very very important question for interview and it is also a commonly asked question PHP interview.
Ans: Constructor is basically a function which creates objects. Constructor enables to initialize the objects within a class, which means that whenever I create any objects in a class, constructor is called first.
Now coming to __construct(). __construct() function is a magic keyword which is denoted by double underscore (__).
For Ex. :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Form Page</title>
</head>
<body>
<form method="post">
Type: <input type="radio" name="type" value="personal">Personal
<input type="radio" name="type" value="organization">Organization<br>
Email: <input type="email" name="email"><br>
Name: <input type="text" name="name"><br>
Password: <input type="password" name="password"><br>
Gender: <input type="radio" name="gender" value="Male">Male
<input type="radio" name="gender" value="Female">Female<br>
<button type="submit" name="submit" value="submit">Submit</button>
</form>
<?php
if (isset($_REQUEST['submit'])) {
$type=$_REQUEST["type"];
$email=$_REQUEST["email"];
$name=$_REQUEST["name"];
$password=$_REQUEST["password"];
$gender=$_REQUEST["gender"];
class Form
{
function __construct($type,$email,$name,$password,$gender)
{
$this->ty=$type;
$this->em=$email;
$this->na=$name;
$this->pa=$password;
$this->ge=$gender;
}
function display()
{
echo $this->ty."<br>".$this->em."<br>".$this->na."<br>".$this->pa."<br>".$this->ge;
}
}
$obj=new Form($type,$email,$name,$password,$gender);
$obj->display();
}
?>
</body>
</html>
Q12. What is meant by Class? Explain with an example.
This is another very very important question for interview and it is also a commonly asked question PHP interview.
Ans: Class is an instance of an object. For example : School Class, Tuition Class, College Class. I think no other real life examples are as better than this.
Q13. What is meant by Objects? Explain with an example.
This is another very very important question for interview and it is also a commonly asked question PHP interview.
Ans: Objects is a container, that contains group of functions, variables and other class objects. Objects is the blueprint of class. For example: Table, Chair, Humam Beigns, etc. this are all examples of Objects. I think no other real life examples are as better than this.
Comments
Post a Comment