SlideShare una empresa de Scribd logo
1 de 37
25 PHP Interview
Questions – Can You Answer
Them All?
Let’s take a look at some tips!
Tip 1
•“One of the most important things I watch out is the
creativity of the person I interview. I try to catch the
developers who are constantly learning new things, they are
driven by curiosity and also very creative, not just in problem
solving but in general too. I mostly ask about PHP and
PostgreSQL (I use this combo most of the time).” ~ Laszlo
Levente Mári, ex-Googler
Tip 2
•“During the interview of a potential candidate I am aiming to
understand how updated they are with the new language
features as well as their level of understanding of basic
operations. In my opinion, this will define how good a
developer will become in the future.” ~Agli Pançi, Lead
Developer
Tip 3
•“I would expect from a junior developer is that know the
basics of programing and how apply these basics to php. I
wouldn’t expect that a Junior Developer knows the name of
certain functions or complex terms on PHP.” ~Oscar Andrés
Monroy, Senior PHP Developer
Now, the interview questions…
Question #1
•What’s the difference between the include() and require()
functions?
Question #2
•How can we get the IP address of the client?
Question #3
•What’s the difference between unset() and unlink() ?
Question #4
•What is the output of the following code:
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
Question #5
•What are the main error types in PHP and how do they
differ?
Question #6
•What is the difference between GET and POST?
Question #7
•How can you enable error reporting in PHP?
Question #8
•What are Traits?
Question #9
•Can the value of a constant change during the script’s
execution?
Question #10
•Can you extend a Final defined class?
Question #11
•What are the __construct() and __destruct() methods in a PHP
class?
Question #12
•How we can get the number of elements in an array?
Question #13
•How would you declare a function that receives one
parameter name hello?
Question #14
•The value of the variable input is a string 1,2,3,4,5,6,7. How
would you get the sum of the integers contained inside input?
Question #15
•Suppose you receive a form submitted by a post to
subscribe to a newsletter. This form has only one field, an
input text field named email. How would you validate
whether the field is empty? Print a message "The email cannot
be empty." in this case.
Question #16
•Suppose that you have to implement a class named
Dragonball. This class must have an attribute named ballCount
(which starts from 0) and a method iFoundaBall. When iFoundaBall
is called, ballCount is increased by one. If the value of ballCount
is equal to seven, then the message “You can ask your wish.” is
printed, and ballCount is reset to 0. How would you
implement this class?
Question #17
•What are the 3 scope levels available in PHP and how
would you define them?
Question #18
•What are getters and setters and why are they important?
Question #19
•What does MVC stand for and what does each component
do?
Question #20
•How does one prevent the following Warning ‘Warning:
Cannot modify header information – headers already sent’
and why does it occur in the first place?
Question #21
•What are SQL Injections, how do you prevent them and
what are the best practices?
Question #22
•What does the following code output?
$i = 016;
echo $i / 2;
Question #23
•Why would you use === instead of ==?
Question #24
•What are PSRs? Choose 1 and briefly describe it.
Question #25
•What PSR Standards do you follow? Why would you follow
a PSR standard?
Question #26
•Do you use Composer? If yes, what benefits have you found
in it?
More to think about…
Extra PHP Interview Practice Questions
•What’s the difference between using mysql_ functions and PDO?
•Describe how inheritance works with PHP.
•Do you know what the PHP-FIG is? Describe it, describe the PSRs
you know.
•What classes would you create to build a basic Twitter-style
status system with OOP?
•What frameworks are you experienced in?
•What frameworks do you prefer? Why?
•Thoughts / experience with unit testing?
Exercise
•Build the Twitter style status system mentioned above
using PHP (it doesn’t have to run or be error-free). This
should be MVP and take less than 30 minutes.
What Else to Brush Up On
Our PHP interview questions here aren’t all-encompassing.
Here are some additional concepts that our mentors think
may be helpful for you brush up:
• Using htmlspecialchars namespaces and short hand array
styles []
• How to optimize code & how to pass user supplied data to
SQL to avoid injection.
Good Luck to Your Interview!!
For answers and more tutorials: https://www.codementor.io/php/tutorial/php-interview-
questions-sample-answers

Más contenido relacionado

La actualidad más candente

Az ve Öz Kotlin - Beyza KOYULMUS
 Az ve Öz Kotlin - Beyza KOYULMUS Az ve Öz Kotlin - Beyza KOYULMUS
Az ve Öz Kotlin - Beyza KOYULMUSBeyzaKOYULMUS
 
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Tekblink Jeeten
 
Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Aaron Saray
 
WordCamp US: Clean Code
WordCamp US: Clean CodeWordCamp US: Clean Code
WordCamp US: Clean Codemtoppa
 
Top 100 PHP Questions and Answers
Top 100 PHP Questions and AnswersTop 100 PHP Questions and Answers
Top 100 PHP Questions and Answersiimjobs and hirist
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Ivo Jansch
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answerssheibansari
 
Intro to programing with java-lecture 1
Intro to programing with java-lecture 1Intro to programing with java-lecture 1
Intro to programing with java-lecture 1Mohamed Essam
 
Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHPmtoppa
 
Writing High Quality Code in C#
Writing High Quality Code in C#Writing High Quality Code in C#
Writing High Quality Code in C#Svetlin Nakov
 
How To Become A Good C# Programmer
How To Become A Good C# ProgrammerHow To Become A Good C# Programmer
How To Become A Good C# ProgrammerLearnItFirst.com
 
Survey on Script-based languages to write a Chatbot
Survey on Script-based languages to write a ChatbotSurvey on Script-based languages to write a Chatbot
Survey on Script-based languages to write a ChatbotNguyen Giang
 
Standard coding practices
Standard coding practicesStandard coding practices
Standard coding practicesAnilkumar Patil
 

La actualidad más candente (20)

Az ve Öz Kotlin - Beyza KOYULMUS
 Az ve Öz Kotlin - Beyza KOYULMUS Az ve Öz Kotlin - Beyza KOYULMUS
Az ve Öz Kotlin - Beyza KOYULMUS
 
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
 
Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012
 
WordCamp US: Clean Code
WordCamp US: Clean CodeWordCamp US: Clean Code
WordCamp US: Clean Code
 
Top 100 PHP Questions and Answers
Top 100 PHP Questions and AnswersTop 100 PHP Questions and Answers
Top 100 PHP Questions and Answers
 
JetBrains MPS
JetBrains MPSJetBrains MPS
JetBrains MPS
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answers
 
Clean code coding like a professional
Clean code   coding like a professionalClean code   coding like a professional
Clean code coding like a professional
 
Web Front End
Web Front EndWeb Front End
Web Front End
 
Intro to programing with java-lecture 1
Intro to programing with java-lecture 1Intro to programing with java-lecture 1
Intro to programing with java-lecture 1
 
Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHP
 
Coding standard
Coding standardCoding standard
Coding standard
 
Writing High Quality Code in C#
Writing High Quality Code in C#Writing High Quality Code in C#
Writing High Quality Code in C#
 
How To Become A Good C# Programmer
How To Become A Good C# ProgrammerHow To Become A Good C# Programmer
How To Become A Good C# Programmer
 
SLOID Share
SLOID ShareSLOID Share
SLOID Share
 
Survey on Script-based languages to write a Chatbot
Survey on Script-based languages to write a ChatbotSurvey on Script-based languages to write a Chatbot
Survey on Script-based languages to write a Chatbot
 
Coding conventions
Coding conventionsCoding conventions
Coding conventions
 
Tdd in practice
Tdd in practiceTdd in practice
Tdd in practice
 
Standard coding practices
Standard coding practicesStandard coding practices
Standard coding practices
 

Destacado

29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview QuestionsArc & Codementor
 
Useful functions for arrays in php
Useful functions for arrays in phpUseful functions for arrays in php
Useful functions for arrays in phpChetan Patel
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical QuestionsPankaj Jha
 
Zend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestZend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestCarlos Buenosvinos
 
37 Java Interview Questions
37 Java Interview Questions37 Java Interview Questions
37 Java Interview QuestionsArc & Codementor
 
Angular 2 interview questions and answers
Angular 2 interview questions and answersAngular 2 interview questions and answers
Angular 2 interview questions and answersAnil Singh
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questionssubash01
 
21 Essential JavaScript Interview Questions
21 Essential JavaScript Interview Questions21 Essential JavaScript Interview Questions
21 Essential JavaScript Interview QuestionsArc & Codementor
 
18 cách kiếm tiền online uy tín nhất
18 cách kiếm tiền online uy tín nhất18 cách kiếm tiền online uy tín nhất
18 cách kiếm tiền online uy tín nhấtkiemtienonline2030
 
Zend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsZend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsJagat Kothari
 

Destacado (16)

29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
 
Useful functions for arrays in php
Useful functions for arrays in phpUseful functions for arrays in php
Useful functions for arrays in php
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical Questions
 
Zend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestZend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification Test
 
Practice exam php
Practice exam phpPractice exam php
Practice exam php
 
37 Java Interview Questions
37 Java Interview Questions37 Java Interview Questions
37 Java Interview Questions
 
Angular 2 interview questions and answers
Angular 2 interview questions and answersAngular 2 interview questions and answers
Angular 2 interview questions and answers
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
Types of Error in PHP
Types of Error in PHPTypes of Error in PHP
Types of Error in PHP
 
MVC in PHP
MVC in PHPMVC in PHP
MVC in PHP
 
21 Essential JavaScript Interview Questions
21 Essential JavaScript Interview Questions21 Essential JavaScript Interview Questions
21 Essential JavaScript Interview Questions
 
IoC and Mapper in C#
IoC and Mapper in C#IoC and Mapper in C#
IoC and Mapper in C#
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
18 cách kiếm tiền online uy tín nhất
18 cách kiếm tiền online uy tín nhất18 cách kiếm tiền online uy tín nhất
18 cách kiếm tiền online uy tín nhất
 
Zend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsZend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample Questions
 

Similar a 25 php interview questions – codementor

Top 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docxTop 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docxSurendra Gusain
 
Top 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docxTop 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docxSurendra Gusain
 
Object Oriented Apologetics
Object Oriented ApologeticsObject Oriented Apologetics
Object Oriented ApologeticsVance Lucas
 
Training methdology testers to developers
Training methdology   testers to developersTraining methdology   testers to developers
Training methdology testers to developersGurumurthy Ramamurthy
 
Surviving the technical interview
Surviving the technical interviewSurviving the technical interview
Surviving the technical interviewEric Brooke
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentShawn Jones
 
Advanced java script essentials v1
Advanced java script essentials v1Advanced java script essentials v1
Advanced java script essentials v1ASHUTOSHPATKAR1
 
NUS Hackers Project Intern 2016
NUS Hackers Project Intern 2016NUS Hackers Project Intern 2016
NUS Hackers Project Intern 2016Vishnu Prem
 
Greythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview GuideGreythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview GuideVaco Seattle
 
How to write a Developer CV/Résumé that will get you hired
How to write a Developer CV/Résumé that will get you hiredHow to write a Developer CV/Résumé that will get you hired
How to write a Developer CV/Résumé that will get you hiredPerl Careers
 
PHP/MySQL Training Course in Delhi, India by IT People
PHP/MySQL Training Course in Delhi, India by IT PeoplePHP/MySQL Training Course in Delhi, India by IT People
PHP/MySQL Training Course in Delhi, India by IT PeopleAbhishekve
 
How to hire a hacker
How to hire a hackerHow to hire a hacker
How to hire a hackerRTigger
 
Good code, Bad Code
Good code, Bad CodeGood code, Bad Code
Good code, Bad Codejosedasilva
 
Best Practices in Software Development
Best Practices in Software DevelopmentBest Practices in Software Development
Best Practices in Software DevelopmentAndré Pitombeira
 
CSCI 180 Project Grading  Your project is graded based .docx
CSCI 180 Project Grading   Your project is graded based .docxCSCI 180 Project Grading   Your project is graded based .docx
CSCI 180 Project Grading  Your project is graded based .docxfaithxdunce63732
 
How to Effectively Lead a Focus Group by nexTier Product Manager
How to Effectively Lead a Focus Group by nexTier Product ManagerHow to Effectively Lead a Focus Group by nexTier Product Manager
How to Effectively Lead a Focus Group by nexTier Product ManagerProduct School
 
Boost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In BanglaBoost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In BanglaStack Learner
 

Similar a 25 php interview questions – codementor (20)

Top 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docxTop 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docx
 
Top 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docxTop 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docx
 
Object Oriented Apologetics
Object Oriented ApologeticsObject Oriented Apologetics
Object Oriented Apologetics
 
Training methdology testers to developers
Training methdology   testers to developersTraining methdology   testers to developers
Training methdology testers to developers
 
Surviving the technical interview
Surviving the technical interviewSurviving the technical interview
Surviving the technical interview
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
 
Advanced java script essentials v1
Advanced java script essentials v1Advanced java script essentials v1
Advanced java script essentials v1
 
NUS Hackers Project Intern 2016
NUS Hackers Project Intern 2016NUS Hackers Project Intern 2016
NUS Hackers Project Intern 2016
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Greythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview GuideGreythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview Guide
 
How to write a Developer CV/Résumé that will get you hired
How to write a Developer CV/Résumé that will get you hiredHow to write a Developer CV/Résumé that will get you hired
How to write a Developer CV/Résumé that will get you hired
 
PHP/MySQL Training Course in Delhi, India by IT People
PHP/MySQL Training Course in Delhi, India by IT PeoplePHP/MySQL Training Course in Delhi, India by IT People
PHP/MySQL Training Course in Delhi, India by IT People
 
How to hire a hacker
How to hire a hackerHow to hire a hacker
How to hire a hacker
 
Good code, Bad Code
Good code, Bad CodeGood code, Bad Code
Good code, Bad Code
 
Best Practices in Software Development
Best Practices in Software DevelopmentBest Practices in Software Development
Best Practices in Software Development
 
CSCI 180 Project Grading  Your project is graded based .docx
CSCI 180 Project Grading   Your project is graded based .docxCSCI 180 Project Grading   Your project is graded based .docx
CSCI 180 Project Grading  Your project is graded based .docx
 
How to Effectively Lead a Focus Group by nexTier Product Manager
How to Effectively Lead a Focus Group by nexTier Product ManagerHow to Effectively Lead a Focus Group by nexTier Product Manager
How to Effectively Lead a Focus Group by nexTier Product Manager
 
Project
ProjectProject
Project
 
Boost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In BanglaBoost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In Bangla
 
Software development fundamentals
Software development fundamentalsSoftware development fundamentals
Software development fundamentals
 

Más de Arc & Codementor

Remote Career Summit 2020 - the State of Remote Jobs - Weiting Liu of Arc
Remote Career Summit 2020 - the State of Remote Jobs - Weiting Liu of ArcRemote Career Summit 2020 - the State of Remote Jobs - Weiting Liu of Arc
Remote Career Summit 2020 - the State of Remote Jobs - Weiting Liu of ArcArc & Codementor
 
Introduction to Python for Data Science
Introduction to Python for Data ScienceIntroduction to Python for Data Science
Introduction to Python for Data ScienceArc & Codementor
 
20 iOS developer interview questions
20 iOS developer interview questions20 iOS developer interview questions
20 iOS developer interview questionsArc & Codementor
 
Top 10 Programming Languages in 2015
Top 10 Programming Languages in 2015Top 10 Programming Languages in 2015
Top 10 Programming Languages in 2015Arc & Codementor
 
How to Build Your App from Scratch
How to Build Your App from ScratchHow to Build Your App from Scratch
How to Build Your App from ScratchArc & Codementor
 
Angular meteor for angular devs
Angular meteor for angular devsAngular meteor for angular devs
Angular meteor for angular devsArc & Codementor
 
Introduction to Tmux - Codementor Tmux Office Hours Part 1
Introduction to Tmux - Codementor Tmux Office Hours Part 1Introduction to Tmux - Codementor Tmux Office Hours Part 1
Introduction to Tmux - Codementor Tmux Office Hours Part 1Arc & Codementor
 
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...Arc & Codementor
 
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Arc & Codementor
 
Python Internals Optimization Choices Made - Codementors Office Hours with St...
Python Internals Optimization Choices Made - Codementors Office Hours with St...Python Internals Optimization Choices Made - Codementors Office Hours with St...
Python Internals Optimization Choices Made - Codementors Office Hours with St...Arc & Codementor
 

Más de Arc & Codementor (11)

Remote Career Summit 2020 - the State of Remote Jobs - Weiting Liu of Arc
Remote Career Summit 2020 - the State of Remote Jobs - Weiting Liu of ArcRemote Career Summit 2020 - the State of Remote Jobs - Weiting Liu of Arc
Remote Career Summit 2020 - the State of Remote Jobs - Weiting Liu of Arc
 
Introduction to Python for Data Science
Introduction to Python for Data ScienceIntroduction to Python for Data Science
Introduction to Python for Data Science
 
20 iOS developer interview questions
20 iOS developer interview questions20 iOS developer interview questions
20 iOS developer interview questions
 
Top 10 Programming Languages in 2015
Top 10 Programming Languages in 2015Top 10 Programming Languages in 2015
Top 10 Programming Languages in 2015
 
How to Build Your App from Scratch
How to Build Your App from ScratchHow to Build Your App from Scratch
How to Build Your App from Scratch
 
Angular meteor for angular devs
Angular meteor for angular devsAngular meteor for angular devs
Angular meteor for angular devs
 
Tmux tips and_tricks
Tmux tips and_tricksTmux tips and_tricks
Tmux tips and_tricks
 
Introduction to Tmux - Codementor Tmux Office Hours Part 1
Introduction to Tmux - Codementor Tmux Office Hours Part 1Introduction to Tmux - Codementor Tmux Office Hours Part 1
Introduction to Tmux - Codementor Tmux Office Hours Part 1
 
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
 
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
 
Python Internals Optimization Choices Made - Codementors Office Hours with St...
Python Internals Optimization Choices Made - Codementors Office Hours with St...Python Internals Optimization Choices Made - Codementors Office Hours with St...
Python Internals Optimization Choices Made - Codementors Office Hours with St...
 

Último

Jumark Morit Diezmo- Career portfolio- BPED 3A
Jumark Morit Diezmo- Career portfolio- BPED 3AJumark Morit Diezmo- Career portfolio- BPED 3A
Jumark Morit Diezmo- Career portfolio- BPED 3Ajumarkdiezmo1
 
Network to Success - Using Social Media in Job Search
Network to Success - Using Social Media in Job SearchNetwork to Success - Using Social Media in Job Search
Network to Success - Using Social Media in Job SearchBruce Bennett
 
Human Rights are notes and helping material
Human Rights are notes and helping materialHuman Rights are notes and helping material
Human Rights are notes and helping materialnadeemcollege26
 
Back on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveBack on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveMarharyta Nedzelska
 
What is the career path of a VFX artist?
What is the career path of a VFX artist?What is the career path of a VFX artist?
What is the career path of a VFX artist?santoshjadhav126
 
Senior IT Professional with Master’s Degree with 21+ years of experience is...
Senior IT Professional with Master’s Degree with 21+ years of experience   is...Senior IT Professional with Master’s Degree with 21+ years of experience   is...
Senior IT Professional with Master’s Degree with 21+ years of experience is...Anas Acharath Parakat
 
LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024Bruce Bennett
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoubGhobrial1
 
Soviet pilot Yuri Gagarin was the first person to ever orbit the Earth
Soviet pilot Yuri Gagarin was the first person to ever orbit the EarthSoviet pilot Yuri Gagarin was the first person to ever orbit the Earth
Soviet pilot Yuri Gagarin was the first person to ever orbit the EarthChristina Parmionova
 
The Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating PressThe Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating Pressmatingpress170
 
Chapter 4 - Promoting Inclusive Culture.ppt
Chapter 4 - Promoting   Inclusive Culture.pptChapter 4 - Promoting   Inclusive Culture.ppt
Chapter 4 - Promoting Inclusive Culture.pptmoytopo
 
Transportation and Trade Part 5 (1) (1).pptx
Transportation and Trade Part 5 (1) (1).pptxTransportation and Trade Part 5 (1) (1).pptx
Transportation and Trade Part 5 (1) (1).pptxSheldon Byron
 
Banged Dubai Call Girls O525547819 Call Girls Dubai
Banged Dubai Call Girls O525547819 Call Girls DubaiBanged Dubai Call Girls O525547819 Call Girls Dubai
Banged Dubai Call Girls O525547819 Call Girls Dubaikojalkojal131
 
Spanish Classes Online In India With Tutor At Affordable Price
Spanish Classes Online In India With Tutor At Affordable PriceSpanish Classes Online In India With Tutor At Affordable Price
Spanish Classes Online In India With Tutor At Affordable PriceFluent Fast Academy
 
LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024Bruce Bennett
 
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptxwaghmare9860lavin
 
Nathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathanBaughman3
 
4. Biomechanical Preparation INTRO AND TECHNIQUES
4. Biomechanical Preparation INTRO AND TECHNIQUES4. Biomechanical Preparation INTRO AND TECHNIQUES
4. Biomechanical Preparation INTRO AND TECHNIQUESaishwaryakhare5
 
How to make career in advance 3d animation
How to make career in advance 3d animationHow to make career in advance 3d animation
How to make career in advance 3d animationsantoshjadhav126
 
Get to know about Raquel Thompson Barbados.pdf
Get to know about Raquel Thompson Barbados.pdfGet to know about Raquel Thompson Barbados.pdf
Get to know about Raquel Thompson Barbados.pdfRaquel Thompson Barbados
 

Último (20)

Jumark Morit Diezmo- Career portfolio- BPED 3A
Jumark Morit Diezmo- Career portfolio- BPED 3AJumark Morit Diezmo- Career portfolio- BPED 3A
Jumark Morit Diezmo- Career portfolio- BPED 3A
 
Network to Success - Using Social Media in Job Search
Network to Success - Using Social Media in Job SearchNetwork to Success - Using Social Media in Job Search
Network to Success - Using Social Media in Job Search
 
Human Rights are notes and helping material
Human Rights are notes and helping materialHuman Rights are notes and helping material
Human Rights are notes and helping material
 
Back on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveBack on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental Leave
 
What is the career path of a VFX artist?
What is the career path of a VFX artist?What is the career path of a VFX artist?
What is the career path of a VFX artist?
 
Senior IT Professional with Master’s Degree with 21+ years of experience is...
Senior IT Professional with Master’s Degree with 21+ years of experience   is...Senior IT Professional with Master’s Degree with 21+ years of experience   is...
Senior IT Professional with Master’s Degree with 21+ years of experience is...
 
LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdf
 
Soviet pilot Yuri Gagarin was the first person to ever orbit the Earth
Soviet pilot Yuri Gagarin was the first person to ever orbit the EarthSoviet pilot Yuri Gagarin was the first person to ever orbit the Earth
Soviet pilot Yuri Gagarin was the first person to ever orbit the Earth
 
The Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating PressThe Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating Press
 
Chapter 4 - Promoting Inclusive Culture.ppt
Chapter 4 - Promoting   Inclusive Culture.pptChapter 4 - Promoting   Inclusive Culture.ppt
Chapter 4 - Promoting Inclusive Culture.ppt
 
Transportation and Trade Part 5 (1) (1).pptx
Transportation and Trade Part 5 (1) (1).pptxTransportation and Trade Part 5 (1) (1).pptx
Transportation and Trade Part 5 (1) (1).pptx
 
Banged Dubai Call Girls O525547819 Call Girls Dubai
Banged Dubai Call Girls O525547819 Call Girls DubaiBanged Dubai Call Girls O525547819 Call Girls Dubai
Banged Dubai Call Girls O525547819 Call Girls Dubai
 
Spanish Classes Online In India With Tutor At Affordable Price
Spanish Classes Online In India With Tutor At Affordable PriceSpanish Classes Online In India With Tutor At Affordable Price
Spanish Classes Online In India With Tutor At Affordable Price
 
LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024
 
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
 
Nathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editor
 
4. Biomechanical Preparation INTRO AND TECHNIQUES
4. Biomechanical Preparation INTRO AND TECHNIQUES4. Biomechanical Preparation INTRO AND TECHNIQUES
4. Biomechanical Preparation INTRO AND TECHNIQUES
 
How to make career in advance 3d animation
How to make career in advance 3d animationHow to make career in advance 3d animation
How to make career in advance 3d animation
 
Get to know about Raquel Thompson Barbados.pdf
Get to know about Raquel Thompson Barbados.pdfGet to know about Raquel Thompson Barbados.pdf
Get to know about Raquel Thompson Barbados.pdf
 

25 php interview questions – codementor

  • 1. 25 PHP Interview Questions – Can You Answer Them All?
  • 2. Let’s take a look at some tips!
  • 3. Tip 1 •“One of the most important things I watch out is the creativity of the person I interview. I try to catch the developers who are constantly learning new things, they are driven by curiosity and also very creative, not just in problem solving but in general too. I mostly ask about PHP and PostgreSQL (I use this combo most of the time).” ~ Laszlo Levente Mári, ex-Googler
  • 4. Tip 2 •“During the interview of a potential candidate I am aiming to understand how updated they are with the new language features as well as their level of understanding of basic operations. In my opinion, this will define how good a developer will become in the future.” ~Agli Pançi, Lead Developer
  • 5. Tip 3 •“I would expect from a junior developer is that know the basics of programing and how apply these basics to php. I wouldn’t expect that a Junior Developer knows the name of certain functions or complex terms on PHP.” ~Oscar Andrés Monroy, Senior PHP Developer
  • 6. Now, the interview questions…
  • 7. Question #1 •What’s the difference between the include() and require() functions?
  • 8. Question #2 •How can we get the IP address of the client?
  • 9. Question #3 •What’s the difference between unset() and unlink() ?
  • 10. Question #4 •What is the output of the following code: $a = '1'; $b = &$a; $b = "2$b"; echo $a.", ".$b;
  • 11. Question #5 •What are the main error types in PHP and how do they differ?
  • 12. Question #6 •What is the difference between GET and POST?
  • 13. Question #7 •How can you enable error reporting in PHP?
  • 15. Question #9 •Can the value of a constant change during the script’s execution?
  • 16. Question #10 •Can you extend a Final defined class?
  • 17. Question #11 •What are the __construct() and __destruct() methods in a PHP class?
  • 18. Question #12 •How we can get the number of elements in an array?
  • 19. Question #13 •How would you declare a function that receives one parameter name hello?
  • 20. Question #14 •The value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?
  • 21. Question #15 •Suppose you receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would you validate whether the field is empty? Print a message "The email cannot be empty." in this case.
  • 22. Question #16 •Suppose that you have to implement a class named Dragonball. This class must have an attribute named ballCount (which starts from 0) and a method iFoundaBall. When iFoundaBall is called, ballCount is increased by one. If the value of ballCount is equal to seven, then the message “You can ask your wish.” is printed, and ballCount is reset to 0. How would you implement this class?
  • 23. Question #17 •What are the 3 scope levels available in PHP and how would you define them?
  • 24. Question #18 •What are getters and setters and why are they important?
  • 25. Question #19 •What does MVC stand for and what does each component do?
  • 26. Question #20 •How does one prevent the following Warning ‘Warning: Cannot modify header information – headers already sent’ and why does it occur in the first place?
  • 27. Question #21 •What are SQL Injections, how do you prevent them and what are the best practices?
  • 28. Question #22 •What does the following code output? $i = 016; echo $i / 2;
  • 29. Question #23 •Why would you use === instead of ==?
  • 30. Question #24 •What are PSRs? Choose 1 and briefly describe it.
  • 31. Question #25 •What PSR Standards do you follow? Why would you follow a PSR standard?
  • 32. Question #26 •Do you use Composer? If yes, what benefits have you found in it?
  • 33. More to think about…
  • 34. Extra PHP Interview Practice Questions •What’s the difference between using mysql_ functions and PDO? •Describe how inheritance works with PHP. •Do you know what the PHP-FIG is? Describe it, describe the PSRs you know. •What classes would you create to build a basic Twitter-style status system with OOP? •What frameworks are you experienced in? •What frameworks do you prefer? Why? •Thoughts / experience with unit testing?
  • 35. Exercise •Build the Twitter style status system mentioned above using PHP (it doesn’t have to run or be error-free). This should be MVP and take less than 30 minutes.
  • 36. What Else to Brush Up On Our PHP interview questions here aren’t all-encompassing. Here are some additional concepts that our mentors think may be helpful for you brush up: • Using htmlspecialchars namespaces and short hand array styles [] • How to optimize code & how to pass user supplied data to SQL to avoid injection.
  • 37. Good Luck to Your Interview!! For answers and more tutorials: https://www.codementor.io/php/tutorial/php-interview- questions-sample-answers