Appinventiv Php Developer Interview Questions

Appinventiv Php Developer Interview Questions
Download Appinventiv Php Developer Interview Questions PDF

Below are the list of Best Appinventiv Php Developer Interview Questions and Answers

In PHP @ is used to suppress error messages.When we add @ before any statement in php then if any runtime error will occur on that line, then the error handled by PHP

crypt(), Mcrypt(), hash() are used for encryption in PHP

Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications. XSS enables attackers to inject client-side script into web pages viewed by other users. A cross-site scripting vulnerability may be used by attackers to bypass access controls such as the same-origin policy.

Some differences are:

GETPOST
It claims request parameter in URL StringIt claims request parameter in the request body
It is able to send a minute amount of dataIt is able to send a great amount of data
It can be cached and bookmarked.It is not able to cache and bookmarked
It is efficient for the view purposeIt is efficient for the update-purpose

An interface can be defined as a platform that permits users to develop programs that mention all public methods that need to be implemented by various classes. It does not involve any complexity or detail of methods used and implemented. An interface can also be defined as the next level of abstraction.

The main use of the interface is to maximize the potential of the reusability of code.

An abstract class can be defined by those classes which have at least one method as abstract. The abstract classes in PHP can be declared with a special keyword namely abstract. The main use of the abstract class is that all base classes which implement this class have to option of giving implementation of methods that are abstract already declared in the parent class.

Overriding and Overloading both are oops concepts.

In Overriding, a method of the parent class is defined in the child or derived class with the same name and parameters. Overriding comes in inheritance.

An example of Overriding in PHP.

<?php

class A {
   function showName() {
      return "Ajay";
   }
}

class B extends A {
   function showName() {
      return "Anil";
   }
}

$foo = new A;
$bar = new B;
echo($foo->myFoo()); //"Ajay"
echo($bar->myFoo()); //"Anil"
?>

In Overloading, there are multiple methods with the same name with different signatures or parameters. Overloading is done within the same class. Overloading is also called early binding or compile time polymorphism or static binding.

An example of Overloading in PHP

<?php 
class A{

function sum($a,$b){
	return $a+$b;

}

function sum($a,$b,$c){
	return $a+$b+$c;

}

}

$obj= new A;
$obj->sum(1,3); // 4
$obj->sum(1,3,5); // 9
?>

You can use library function array_unique() for removing duplicated values for an array. Here is syntax to use it.

<?php
	$a=array("a"=>"home","b"=>"town","c"=>"town","php");
	print_r(array_unique($a));
?>


Both strstr() as well as stristr() in PHP are used for the purpose of finding the first occurrence of the string. The only difference between the two is while strstr() is case sensitive but on the other hand, stristr() is case insensitive.

Both GROUP and ORDER BY clauses are used for organizing data in MYSQL.

  • ORDER BY clause is used to sort the query result by specific columns.
  • GROUP BY clause is used to summarize unique combinations of columns values.

You can use subquery and IN clause to find the Second highest salary from a table in MySQL

SELECT max(salary) FROM Employee WHERE salary NOT IN (SELECT max(salary) FROM Employee);

A trigger can be defined as that stored procedure that executes when some particular event happens in SQL such as update, insert, delete, etc. On the other hand, a stored procedure is a piece of code purely defined by the user and is written in several local versions of PL or SQL. A stored procedure may return a value if it is made a function and can be invoked by calling it explicitly.

Inner Join: Inner Join can also be called the simple join. It allows the coder to filter the outcomes of the cartesian product by some predicate.

Self Join: It is used to join one single table with itself as there were two different tables.

Cross Join: This is the basic join, it is nothing but a cartesian product. This join method compares every single row of a table with every single row of the other table.

Different types of data storage engines available in Mysql are:

  • MyISAM
  • InnoDB
  • MERGE
  • MEMORY (HEAP)
  • ARCHIVE
  • CSV
  • FEDERATED

Indexes can be defined as a process used to speed up the retrieval of data. These are a special kind of lookup tables that the search engine of the database can be used for the purpose of improving the speed of the data. It can be done by putting a pointer named Index to data in a table. It works similar to that of the index of any book.

In PHP5 or above, type hinting is a process used to specify the data type of a given argument. This is mainly used in a function declaration. Whenever the function is called, PHP checks if the arguments are of the type preferred by the user or not. If the argument is not of the specified type, the run time will display an error and the program will not execute.