Top 10 Questions asked during Interview from Freshers PHP Developers
![]() |
Top 10 Questions asked during Interview from Freshers PHP Developers |
In this post,I tell you top 10 questions which have 90% chance to be asked.I already given many interviews as fresher for PHP developer in chandigarh, mohali, zirakpur and panchkula.
Top 10 Questions :
Ques - What is difference between Sessions and Cookies ?
Ans - The main difference between a session and a cookie is that session data is stored on the server, whereas cookies store data in the visitor's browser.Sessions are more secure than cookies as it is stored in server.Cookie can be turn off from browser.
Ques - How to find largest number from database in PHP?
Ans - you can use MAX() functions like this "Select max(number) from number"; or You can also use "order by" clause with DESC and fetch the first row from result-set.
Ques - What are joins and types of joins?
Ans - A JOIN clause is used to combine rows from two or more tables, based on a related column between them.
Types of joins -
- (INNER) JOIN: Returns records that have matching values in both tables.
- LEFT (OUTER) JOIN: Return all records from the left table, and the matched records from the right table.
- RIGHT (OUTER) JOIN: Return all records from the right table, and the matched records from the left table.
- FULL (OUTER) JOIN: Return all records when there is a match in either left or right table.
Ques - What is the syntax of INNER join?
Ans- SELECT column_name(s) FROM table1 INNER JOIN table2 ON table1.column_name = table2.column_name;
Ques - Name any five array functions?
Ans - Five array functions are -
- array - Creates an array.
- array_fill - Fills an array with values.
- array_reverse - Returns an array in reverse order.
- array_sum - Returns the sum of values in an array.
- array_keys - Returns all the keys of an array.
Ques - Name five string handling functions?
Ans - Five string handling functions are :
- strlen() - Calculates the length of string
- strcpy() - Copies a string to another string
- strcat() - Concatenates(joins) two strings
- strcmp() - Compares two string
- strupr() - Converts string to uppercase
Ques - What is full form of OOPS and Features of OOPS?
Ans - OOPS - Object-Oriented Programming System.
Features -
- Encapsulation - Binding (or wrapping) code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines.
- Abstraction - Hiding internal details and showing functionality is known as abstraction. For example: phone call, we don't know the internal processing.
- Inheritance -When one object acquires all the properties and behaviours of parent object i.e. known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism.
- Polymorphism - When one task is performed by different ways i.e. known as polymorphism. For example: to convince the customer differently, to draw something e.g. shape or rectangle etc.
Ques - What is implode and Explode function?
Ans - The implode() function returns a string from the elements of an array and explode() function breaks a string into an array.
Ques - Write syntax of Insert , Delete, Update and Select data?
Ans -
- Insert - INSERT INTO table_name (column1, column2,column3,...) VALUES (value1, value2, value3,...);
- Delete - DELETE FROM table_name WHERE some_column = some_value;
- Update-UPDATE table_name SET column1=value,column2=value2,...WHERE some_column=some_value ;
- Select - SELECT column_name(s) FROM table_name;
Ques - What is foreign Key?
Ans - A FOREIGN KEY is a key used to link two tables together. A FOREIGN KEY is a field (or collection of fields) in one table that refers to the PRIMARY KEY in another table.
Ques - Difference between GET and POST method?
Ans - Get request is not secured because data is exposed in URL bar Whereas, Post request is secured because data is not exposed in URL bar.
In case of Get request, only limited amount of data can be sent because data is sent in header. In case of post request, large amount of data can be sent because data is sent in body.
{[['
']]}
Informative blog and it was up to the point describing the information very effectively. Thanks to blog author for wonderful and informative post...
ReplyDeletePHP developers in chennai | PHP developers in India