Cracking PHP Interviews : 80+ Question and Answers

Cracking PHP Interviews : 80+ Question and Answers

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 2.5 Hours | 793 MB

Get ready for your next PHP interview under 3 hours with important interview question and answers

How about Quickly Revising all the Important PHP Concepts in less than 3 hours before an interview?

Preparing for PHP Interview is tricky. You would need to get a good understanding of new features and revise the concepts you used in your preparation. This course helps you Prepare for PHP Interview with hands-on code examples covering 80+ PHP Interview Question and Answer on a varied range of topics listed below.

Questions Discussed in this Interview Course

PHP Platform

  • What is PHP?
  • Is PHP case sensitive?
  • Is PHP weakly typed language?
  • How do we install PHP?
  • What is Composer?
  • What is Packagist?
  • How do we execute a PHP script from the command line?
  • What is virtual host?
  • What are XAMPP & WAMP?
  • What is Apache server?
  • How to check current PHP version and other information about our system?
  • What is interpreter?
  • Is PHP compiled or interpreted?
  • What do we mean by a Framework?
  • What is MVC?

Datatypes and variables

  • What is a datatype?
  • How many datatypes are there?
  • What are rules for naming a variable?
  • How will you define a constant?
  • What is the purpose of constant() function?
  • What are the differences between constants and variables?
  • What are the different scopes of variables?
  • What is string?
  • What is the difference between single quoted string and double quoted string?
  • How can you convert string into array elements?
  • How can you convert array into strings?
  • How can you concatenate two or more strings?
  • Differentiate between echo and print().
  • Explain static variables.
  • What are PHP magic constants?
  • Why do we need trim() function?
  • Can you count the number of words in a string?
  • How to reverse a string?
  • How can you change cases in a string?
  • Can you replace a substring?
  • Differentiate between str_replace() and str_ireplace().
  • Differentiate between printf() and print().
  • Differentiate between strstr() & strchr() functions.
  • Differentiate between strstr() and stristr().
  • Can you encode a string in PHP?
  • Differentiate between strcmp() and strncmp().
  • Is it possible to remove the HTML tags from data?
  • What is the use of gettype() in PHP?
  • What is heredoc and nowdoc?

Flow control and Iterations

  • Explain if-else statement.
  • Explain switch statement with example.
  • Differentiate between switch and if-else statement.
  • What are the different types of operators?
  • Explain arithmetic operators.
  • Explain the assignment operators.
  • Explain the logical operators.
  • Explain the unary operators.
  • Explain the comparison operators.
  • Differentiate between === and == operators in PHP.
  • Explain pre and post increment with example.
  • What do you mean by operator overloading?
  • How many loops are available in PHP?
  • Explain while loop with example.
  • Explain do-while loop with example.
  • Explain for loop with example.
  • Explain foreach loop with example.
  • How can you implement an infinite loop in PHP?
  • How can you implement recursion in PHP?
  • Differentiate between iteration and recursion.
  • Explain break statement with example.
  • Explain continue statement with example.
  • Give example of declaration in php?
  • What is require in PHP?

Arrays

  • What is an array?
  • How can you print an array in PHP?
  • What do we mean by the base address of an array?
  • What do we mean by keys and values?
  • What are the keys & values in an indexed array?
  • How can we convert array into string?
  • How can we convert a string into an array elements?
  • How can we concatenate arrays in PHP?
  • Which function counts all the values of an array?
  • How can we check if an element exists in an array?
  • Which function inserts an element to the end of an array?
  • What is the use of array_chunk() function?
  • Why do we use extract()?

Functions

  • What is a function?
  • What are the different types of functions?
  • Explain call by value.
  • Explain call by reference.

Following questions are available with the Q&A PDF provided in the course (videos on the following questions are coming soon)

  • What are the function declaration rules?
  • How can we declare user defined functions?
  • What do we mean by actual and formal parameters?
  • Maximum how many arguments are allowed in a function in PHP?
  • Explain header().
  • What do we mean by return type of a function?
  • What is the return type of a function that doesn’t return anything?
  • Do we need to mention the return type of a function explicitly in PHP?
  • What is function that can be used to build a function that accepts any number of arguments?
  • Explain the return statement.
  • Can we use multiple return statements in a function?
  • What is the use of ini_set()?
  • What is the difference between unlink and unset functions?
  • How ereg() function works?
  • How eregi() function works?
  • What is the purpose of getdate() function?
  • What is the purpose of date() function?
  • How will you call member functions of a class?

Requests and responses

  • How can we display the correct URL of the current webpage?
  • How to get the information about the uploaded file in the receiving script?
  • What do we mean by server?
  • What is a client?
  • What do you mean by a response?
  • What is HTTP?
  • What are PHP superglobals?
  • How will we get information sent via GET method?
  • How will you get information sent via POST method?
  • What is the purpse $_REQUEST variable?
  • What is the purpose of $_FILES variable?
  • What is the purpose of $GLOBALS variable in PHP?
  • What is the purpose of $_SERVER variable in PHP?
  • What is the purpose of $_COOKIE variable in PHP?
  • What do you mean by environment variable in PHP?
  • What is the purpose of $_ENV variable in PHP?
  • What is the purpose of $_SESSION variable in PHP?
  • How will you redirect a page?
  • What is the purpose $_PHP_SELF variable?
  • How will you get the browser’s details using PHP?
  • What do you mean by HTTP status codes?
  • What are the HTTP client error codes?
  • What are the informational status codes?
  • What are the HTTP success codes?
  • How do you get the redirection related information?
  • What are the HTTP client error codes?
  • What are the HTTP server error codes?
  • What is API?
  • What is the use of an API?
  • What are types of API?
  • What is REST API?
  • Why do we need REST API?
  • Where REST API is used?
  • What is JSON?
  • Why do we need JSON?
  • How can you exchange data using JSON?
  • Differentiate between JSON & XML.
  • What are the advantages of JSON?

Sessions and Cookies

  • What is Session?
  • What is Cookie?
  • Differentiate between Session & Cookie.
  • How do we start a session?
  • How can we set session variable?
  • How to destroy a session?
  • How to remove value from session variable?
  • When do we need to set session variables?
  • When do we need a session and not a cookie?
  • When do we need a cookie and not a session?
  • How can we set a cookie?
  • How to modify a cookie value?
  • How will we make a check that a cookie is set or not?
  • How to retrieve all cookie values?
  • How to delete a cookie?
  • How can we implement ‘remember me’ using PHP?
  • Classify cookies.
  • How will you delete a cookie?
  • How to track login and logout using PHP?

Filesystem management

  • How to create a file?
  • What are the other way to write in a file?
  • How will you check if a file exists or not using php?
  • How to delete a file?
  • How to copy a file?
  • How to rename file?
  • How to check whether a file or directory exists?
  • How to check path of the file in PHP?
  • How to check size of the file in PHP?
  • How to write the contents inside file?
  • Explain file() method.
  • How To change the file permissions?
  • What are different ways to get the extension of a file?
  • How to create a directory using PHP?
  • How to get files(contents) from directory?
  • How to open a directory?
  • What is include in php?
  • What is require_once in php?
  • What is include_once in php?
  • What is require() in PHP?
  • What is difference between require and include?

Regular Expressions

  • What is RegEx?
  • Why do we need RegEx?
  • How preg_match() function works?
  • Regualar Expression Notations.
  • Regualar Expression Examples.

OOPs Concepts

  • What is OOPs?
  • What is an object?
  • How can we create object of a class?
  • What is a class?
  • What are the basic features of OOPs?
  • Is PHP purely an object oriented language?
  • Differentiate between OOPs & POPs.
  • What is generalization?
  • What is specialization?
  • What is aggregation?
  • What is composition?
  • What is association?
  • What is abstraction?
  • What is encapsulation?
  • What is inheritance?
  • What is super class?
  • What is a sub class?
  • How can you inherit a class in PHP?
  • What is a constructor?
  • Explain __construct().
  • Classify constructor.
  • What is a destructor?
  • Explain $this.
  • Explain multiple inheritance.
  • Does PHP support multiple inheritance?
  • Explain multi-level inheritance.
  • What is polymorphism?
  • What is method overloading?
  • Does PHP support method overloading?
  • What is method overriding?
  • What are interfaces in PHP?
  • What does the presence of operator ‘::’ represent?
  • How to define a class in PHP?
  • How will you add a constructor function to a PHP class?
  • How will you add a destructor function to a PHP class?
  • How will you access the reference to same object within the object in PHP?
  • What do you mean by access modifier?
  • Explain access modifiers in PHP.
  • Explain final class in PHP.
  • Explain abstract class.
  • What is interface?

Exception Handling

  • What do you mean by an exception?
  • Define Exception class Hierarchy.
  • How do we handle exceptions?
  • Differentiate between exception and error.
  • What do we mean by error log?
  • How do we see PHP errors?
  • What are the exception class functions?
  • What does the expression Exception::__toString means?

Security and Cryptography

  • Why do we need cryptography?
  • What do we mean by hash functions?
  • Whart is hash function in PHP?
  • Example using hash().
  • What is encoding and decoding?
  • What is SHA1?
  • Can sha1 be decrypted?
  • What is sha1_file()?
  • What are the disadvantages of sha1()?
  • What MD5 means?
  • Why can not a MD5 hash be decrypted?
  • Is md5 reversible?
  • Compare sha1() and md5().
  • What is enctype?
  • Explain each Mcrypt function supported in PHP.
  • What is cryptography authentication?

PHP and HTML

  • What is HTML?
  • Differentiate between PHP and HTML.
  • What are the different methods or HTTP verbs of sending data to the server?
  • What’s the difference between GET and POST methods.
  • How can we send email?
  • How file upload works?

PHP and SQL

  • What is SQL?
  • Why do we need SQL with PHP?
  • How many types of database connections possible in PHP.
  • Adavantages of PDO over MySQLi approach.
  • How connect to the database using PDO?
  • What is SQL injection?

Miscellaneous

  • How can we get the browser’s details using PHP
  • What is the use of Xdebug extension?
  • What is the purpose of php.ini file?
  • What is curl?
  • What is PDO in PHP?
  • What is autoloading classes in PHP?
  • Discuss die().
  • What are variable variable?

New features in PHP 7

  • What are return type declarations?
  • Explain the Exception Hierarchy introduced in PHP 7?
  • What is use of Spaceship Operator?
  • What is use of Null Coalesce Operator?

What you’ll learn

  • Quickly revise all important PHP concepts
  • Beginners to Advance level interview questions
  • Learn OOPs concepts
  • New features in PHP 7
Table of Contents

Course Introduction and Downloads
1 Introduction
2 List of changes
3 I’m your helping hand

PHP Platform
4 What is PHP
5 What is Apache server
6 How to check current PHP version and other information about our system
7 What is interpreter
8 Is PHP compiled language or interpreted language
9 What do we mean by a Framework
10 What is MVC
11 Is PHP case sensitive
12 Is PHP weakly typed language
13 How do we install PHP
14 What is Composer
15 What is Packagist
16 How do we execute a PHP script from the command line
17 What is virtual host
18 What are XAMPP & WAMP

Datatypes and variables
19 Datatype
20 How can you convert string into array elements
21 How can you convert array into strings
22 How can you concatenate two or more strings
23 Differentiate between echo and print()
24 Static variable
25 What are PHP magic constants
26 Why do we need trim() function
27 Counting number of words in a String
28 Reversing a string
29 Position of a specific text in string
30 Types of Datatype
31 Changing alphabetical cases of string
32 Can you replace a substring
33 Differentiate between str replace() and str ireplace()
34 Differentiate between printf() and print().
35 Differentiate between strstr() & strchr() functions.
36 Differentiate between strstr() and stristr().
37 Can you encode a string in PHP
38 Differentiate between strcmp() and strncmp().
39 Is it possible to remove the HTML tags from data
40 What is the use of gettype() in PHP
41 Declaring a variable
42 What is heredoc and nowdoc
43 Defining a constant
44 The constant() function
45 Constant vs variables
46 Scopes of variables
47 What is string
48 What is the difference between single quoted string and double quoted string

Flow control and Iterations
49 Explain if-else statement.
50 Explain foreach loop with example.
51 How can you implement an infinite loop in PHP
52 How can you implement recursion in PHP
53 Iteration vs Recursion
54 The break statement
55 The continue statement
56 The declare construct
57 include vs require
58 Explain switch statement with example.
59 Differentiate between switch and if-else statement.
60 What are the different types of operators
61 Differentiate between === and == operators in PHP.
62 Explain pre and post increment with example.
63 What do you mean by operator overloading
64 Explain while loop with example.
65 Explain for loop with example.

Arrays
66 Arrays
67 Adding new elements to array using array push()
68 Using array chunk() to split arrays
69 Using extract() to create symbol table
70 Printing arrays
71 Understanding base address of array
72 What are key-values in arrays
73 Turning arrays into strings
74 Convert strings to arrays
75 Merging or combining arrays
76 Counting frequency of values in arrays
77 Checking for existence of a value in array

Functions
78 Functions and their uses
79 Types of functions
80 Call by value of method params
81 Call by reference of method params