🏢 1. TCS PHP Interview Questions
👉 Focus: Basics + Logic + Clean Coding
🔹 Common Questions:
- What is PHP? How does it work?
- Difference between
GETandPOST - What are sessions and cookies?
- Difference between
echoandprint - Write a function to check prime number
- Reverse a string using function
- What is
isset()vsempty() - Types of errors in PHP
- What is MVC?
- Simple program using function (sum, factorial)
💻 Coding Example:
function isPrime($num) {
if ($num <= 1) return false;
for ($i = 2; $i < $num; $i++) {
if ($num % $i == 0) return false;
}
return true;
}
🏢 2. Infosys PHP Interview Questions
👉 Focus: Concept + Practical Understanding
🔹 Common Questions:
- What are PHP functions?
- Types of arrays in PHP
- What is recursion? Example
- Difference between
includeandrequire - What are superglobals?
- What is a closure?
- Explain
array_map()andarray_filter() - How to connect PHP with MySQL?
- What is OOP in PHP?
- What is XSS and SQL Injection?
💻 Coding Example:
$arr = [1,2,3,4];$result = array_filter($arr, function($n){
return $n % 2 == 0;
});print_r($result);
🏢 3. Wipro PHP Interview Questions
👉 Focus: Logic + Real Use Cases
🔹 Common Questions:
- Difference between
==and=== - What is function overloading?
- What are variable functions?
- What is
explode()andimplode()? - Write recursive function for factorial
- What is session management?
- How to upload file in PHP?
- What is
$_POSTand$_GET? - What is API?
- What is JSON?
💻 Coding Example:
function factorial($n) {
if ($n == 0) return 1;
return $n * factorial($n - 1);
}
🏢 4. Accenture PHP Interview Questions
👉 Focus: Scenario-based + Problem Solving
🔹 Common Questions:
- How PHP handles form data?
- What are cookies vs sessions?
- How to secure a PHP application?
- What is REST API?
- What is middleware?
- What is
callabletype? - Explain closures with example
- Difference between frontend and backend
- What is AJAX?
- How to optimize PHP performance?
💻 Coding Example:
$sum = fn($a, $b) => $a + $b;
echo $sum(5, 10);
🏢 5. HCL / Tech Mahindra / Capgemini
👉 Focus: Mixed (Basic + DB + Web)
🔹 Common Questions:
- What is PHP lifecycle?
- What are superglobals (
$_SERVER,$_SESSION) - What is MVC architecture?
- What is Composer?
- What is Laravel?
- Difference between
require_onceandinclude_once - How to handle errors in PHP?
- What is CSRF?
- How to validate forms?
- What is RESTful API?
🔥 HR + Technical Combined Questions
👉 Asked in almost all companies:
- Tell me about yourself
- Explain your PHP project
- What challenges did you face?
- Why should we hire you?
- Difference between JavaScript and PHP
- What is your role in project?
🎯 Most Important Topics (HIGH PROBABILITY)
Focus strongly on:
✅ Functions (closures, recursion)
✅ Arrays (array_map, array_filter)
✅ Forms (GET, POST)
✅ Sessions & Cookies
✅ MySQL + PHP
✅ Security (XSS, SQL Injection)
✅ OOP Basics
✅ API / JSON
🚀 Pro Tip (Very Important)
👉 Service-based companies don’t expect deep expertise
👉 They check:
- Clear basics
- Logic building
- Confidence
🧠 Final Practice Set
Prepare these before interview:
- Palindrome function
- Fibonacci using recursion
- Login system (session-based)
- Form handling (
POST) - API fetch + JSON decode






