search
HomeBackend DevelopmentPHP TutorialSummary of PHP interview knowledge points

Summary of PHP interview knowledge points

Jul 14, 2018 am 11:41 AM
php interview

This article mainly introduces a summary of the PHP interview knowledge points, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

Copy it and make a table of contents. Since I don’t know the specific details, I plan to slowly study all the questions in the list

PHP interview best practices in China

This warehouse mainly summarizes the knowledge points that are often asked in domestic PHP interviews. It only points out knowledge points in a targeted manner, and you need to find relevant information and study systematically by yourself. I hope you can understand not only what it is, but also why and the principles behind it.

If you have very systematic information on the corresponding knowledge points, you are welcome to PR to add links. It is not recommended that you use fork, the information will be updated at any time.

If you are in the following situations now, this information is very suitable for you:

  • Preparing to change jobs, but don’t know where to start

  • Technology has encountered a bottleneck and I don’t know what to learn

  • I am planning to learn PHP, but I don’t know how deep the field is

Basics

  • Understand most of the array processing functions

  • String processing functions (different from mb_ ​​series functions)

  • & Quotation, combined with case analysis

  • The difference between == and ===

  • The difference between isset and empty

  • Understand all magic functions

  • static, $this, self difference

  • private, protected, public , final difference

  • OOP idea

  • Abstract classes and interfaces are used separately

  • Trait is What

  • The difference between echo, print and print_r

  • The difference between __construct and __destruct

  • static Function (distinguish between classes and functions)

  • __toString() Function

  • Single quotes' and double quotes"Difference

  • Common HTTP status codes, what do they mean

  • 301 What does 404 mean

Advanced article

  • Autoload, Composer principle

  • Session sharing, survival time

  • Exception handling

  • How to foreach iterate object

  • How to array the operation object $obj[key]

  • How to functionalize the object $obj(123);

  • What is yield, tell me the usage scenario

  • What is PSR, PSR-1, 2, 4, 7

  • How to obtain the client IP and server IP address

  • How to enable PHP exception prompt

  • How to return a 301 redirect

  • How to obtain the extension installation path

  • The principle of comparing strings and numbers. Pay attention to the octal system starting with 0 and the hexadecimal system starting with 0x.

  • What is the BOM header and how to remove it

  • What is MVC

  • Dependency injection implementation principle

  • How to execute commands asynchronously

  • What is a template engine, what problems it solves, and implementation principles (Smarty, Twig, Blade)

  • How to implement chain operations $obj->w()->m ()->d();

  • ##Xhprof and Xdebug performance debugging tools use

  • index array

    [1 , 2] What is the difference between associative array ['k1'=>1, 'k2'=>2]

  • ##Practice

    Given a two-dimensional array, sort according to a certain field
  • How to determine the upload file type, such as: only jpg upload is allowed
  • Do not use temporary variables to exchange the values ​​of two variables
  • $a=1; $b=2;

    => $a=2; $b=1;

  • strtoupper There are garbled characters when converting Chinese, how do you solve it?
  • php echo strtoupper('ab hello c');

    ##Websocket, Long-Polling, Server-Sent Events(SSE) Difference
  • What does the "Headers already sent" error mean and how to avoid it

Algorithm

  • Quick sort (handwritten)

  • Bubble sort (handwritten)

  • Binary search (understand)

  • Search algorithm KMP (understand)

  • Depth and breadth first search (understand) )

  • LRU cache elimination algorithm (understand, Memcached uses this algorithm)

Data structure article (understand)

  • Heap and stack characteristics

  • Queue

  • Hash table

  • Linked list

Comparison

  • Difference between Cookie and Session

  • GET and POST Difference between

  • include and require Difference between

  • ## The difference between #include_once and require_once

  • The difference between Memcached and Redis

  • MySQL storage engines and differences ( You will definitely ask about the difference between MyISAM and Innodb)

  • The difference between HTTP and HTTPS

  • The difference between Apache and Nginx

  • define() and const The difference

  • The difference between traits and interfaces and what pain points do traits solve?

  • The difference between Git and SVN

Database article

  • MySQL

    • Index, joint index (hit condition)

    • Sub-database and sub-table (Horizontal sub-table, Vertical table partition)

    • Partition

    • will use explain to analyze SQL performance issues and understand the meaning of each parameter

    • Slow Log (what is it used for, when is it needed)

    • Key points to understand typerowskey

    • CRUD

    • ##JOIN、LEFT JOIN、RIGHT JOIN、INNER JOIN

    • UNION

    • GROUP BY COUNT WHERE combination case

    • Commonly used MySQL functions, such as: now(), md5( ), concat(), uuid(), etc.

    • 1:1, 1:n, n:nApplicable scenarios for each

    • Understand what a trigger is and tell me a usage scenario

    • Database optimization methods

  • MSSQL(Understand)

    • Query the latest 5 pieces of data

  • NOSQL

    • Persistence

    • Supports multi-clock data types

    • Can utilize multiple CPU cores

    • Memory elimination mechanism

    • ClusterCluster

    • Support SQL

    • Performance comparison

    • Support transactions

    • Application scenarios

    • Redis, Memcached, MongoDB

    • Comparison and applicable scenarios (can be compared from the following dimensions)

    • What did you use to solve what problem before, and why did you choose it?

Server Chapter

  • View CPU, memory, time, system version and other information

  • find, grep to find files

  • awk to process text

  • View the directory where the command is located

  • Have you ever compiled PHP yourself? How to turn on the readline function

  • How to check the memory and CPU usage of the PHP process

  • How to add an extension to PHP

  • Modify the PHP Session storage location and modify the INI configuration parameters

  • What are the types of load balancing? Pick one you are familiar with and explain its principle

  • How is the database master-slave replication M-S synchronized? Push or pull? Will it be out of sync? What to do

  • How to ensure the availability of data, even if the database is deleted, it can be restored to the level of minutes. what will you do.

  • There are too many database connections, exceeding the maximum value. How to optimize the architecture. From what convenience can we handle it?

  • 502 What is the possible reason? How to troubleshoot 504?

Architecture Chapter

  • Partial operation and maintenance (understanding):

    • Load balancing (Nginx, HAProxy, DNS)

    • Master-slave replication (MySQL, Redis)

    • Data redundancy, backup (MySQL incremental, full principle)

    • Monitoring check (two dimensions of survival and service availability)

    • MySQL, Redis, Memcached Proxy, Cluster purpose and principle

    • Sharding

    • High Availability Cluster

    • RAID

    • ## Source code compilation, memory tuning

  • caching

    • Wherever you encounter the need for caching during work, briefly describe why.

  • Search solution

  • Performance tuning

  • Monitoring solution for each dimension

  • Log collection centralized processing solution

  • Internationalization

  • Database design

  • Static solution

  • Draw common PHP application architecture diagram

Framework

  • ThinkPHP (TP), CodeIgniter (CI), Zend (non-OOP series)

  • Yaf, Phalcon (C extension system)

  • Yii, Laravel, Symfony (pure OOP series)

  • Swoole, Workerman (network programming framework)

  • Comparison frameworks differ in several directions Click

    • Whether it is pure OOP

    • Class library loading method (write your own autoload and compare with composer standard)

    • Ease of use direction (CI basic framework, Laravel is a high development efficiency framework and basic components)

    • Black box (compared to C extension system)

    • Running speed (such as: Laravel loads a lot of things)

    • Memory usage

Design pattern

  • Single case pattern (emphasis)

  • Factory pattern (emphasis)

  • Observer pattern (emphasis)

  • Dependency injection (emphasis)

  • Decorator pattern

  • Proxy mode

  • Combined mode

Security

  • SQL injection

  • XSS and CSRF

  • Input Filtering

  • Cookie Security

  • Disable mysql_ System function

  • What should be done to ensure safety when the database stores user passwords

  • Verification code Session problem

  • Secure Session ID (so that even after interception, it cannot be simulated)

  • Directory permissions Security

  • Includes local and remote files

  • File upload PHP script

  • ##eval Function execution script

  • disable_functions Turn off high-risk functions

  • FPM independent users and groups, for each directory Specific permissions

  • Understand the difference between Hash and Encrypt

Advanced level

  • PHP array underlying implementation (HashTable Linked list)

  • Copy on write principle, when GC

  • PHP process model, process communication method, process thread difference

  • What is the core principle of yield

  • PDO prepare principle

  • What is the difference between PHP 7 and PHP 5

  • Swoole applicable scenarios, coroutine implementation method

Front-end article

  • Natively obtain DOM nodes , attributes

  • ##Box model
  • CSS file, style tag, inline style attribute priority
  • HTML and JS running order (page JS from top to bottom)
  • JS array operation
  • Type judgment
  • this scope
  • .map() and this specific usage scenario analysis
  • Cookie reading and writing
  • JQuery operation
  • Ajax request (synchronization, asynchronous difference) random number prohibits caching
  • What are the benefits of Bootstrap
  • N solutions for cross-domain requests
  • New technology (understand)
    • ES6
    • ##Modular
    • Packaging
    • Build tools
    • vue, react, webpack,
    • Front-end mvc
    • Optimization
  • Browser single domain name concurrency limit
    • Static resource cache 304 (If-Modified-Since and Etag principle)
    • Merge multiple small icons and use position positioning technology to reduce requests
    • Static resources are combined into a single request and compressed
    • CDN
    • Static resource delayed loading technology, preloading technology
    • keep-alive
    • CSS is in the head, JS is in Tail optimization (principle)
    • Network article

IP address to INT
  • 192.168.0.1/16 What does it mean

  • What is the main function of DNS?

  • The difference between IPv4 and v6

Network programming

  • TCP three-way handshake process

  • The difference between TCP and UDP, applicable scenarios respectively

  • Is there any way to ensure high availability of UDP (understand)

  • How to solve TCP sticky packets?

  • Why do we need a heartbeat?

  • What is a long connection?

  • How does HTTPS ensure security?

  • The difference between streams and datagrams

  • There are several ways to communicate between processes, which one is the fastest?

  • fork() What will happen?

API Chapter

  • What is RESTful

  • How to use it if it is not supported DELETE The requested browser is compatible with DELETE Requesting

  • common API APP_ID APP_SECRET What is the main function? Explain the process

  • #How does API request ensure that the data is not tampered with?

  • The difference between JSON and JSONP

  • The difference between data encryption and signature verification

  • RSA is What

  • How to deal with API version compatibility

  • Current limiting (barrel, token bucket)

  • OAuth 2 is mainly used in what scenarios

  • JWT

  • ##PHP

    json_encode(['key'=>123 ]); and return json_encode([]); What are the differences? How to solve

Bonus points

  • Understand common language features and applicability in different scenarios.

    • PHP VS Golang

    • PHP VS Python

    • PHP VS JAVA

  • ##Understand PHP extension development

  • Proficient in C

Statement

This information is not directed at any company, and we are not responsible for the impact of this information on you. Hope to know.

Good luck

The above is the entire content of this article. I hope it will be helpful to everyone’s study. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

php Daniel shared: PHP code writing specifications, a comprehensive summary

For PHP Summary of the five principles of object-oriented design (SOLID)

The above is the detailed content of Summary of PHP interview knowledge points. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How does PHP type hinting work, including scalar types, return types, union types, and nullable types?How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

How does PHP handle object cloning (clone keyword) and the __clone magic method?How does PHP handle object cloning (clone keyword) and the __clone magic method?Apr 17, 2025 am 12:24 AM

In PHP, use the clone keyword to create a copy of the object and customize the cloning behavior through the \_\_clone magic method. 1. Use the clone keyword to make a shallow copy, cloning the object's properties but not the object's properties. 2. The \_\_clone method can deeply copy nested objects to avoid shallow copying problems. 3. Pay attention to avoid circular references and performance problems in cloning, and optimize cloning operations to improve efficiency.

PHP vs. Python: Use Cases and ApplicationsPHP vs. Python: Use Cases and ApplicationsApr 17, 2025 am 12:23 AM

PHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.

Describe different HTTP caching headers (e.g., Cache-Control, ETag, Last-Modified).Describe different HTTP caching headers (e.g., Cache-Control, ETag, Last-Modified).Apr 17, 2025 am 12:22 AM

Key players in HTTP cache headers include Cache-Control, ETag, and Last-Modified. 1.Cache-Control is used to control caching policies. Example: Cache-Control:max-age=3600,public. 2. ETag verifies resource changes through unique identifiers, example: ETag: "686897696a7c876b7e". 3.Last-Modified indicates the resource's last modification time, example: Last-Modified:Wed,21Oct201507:28:00GMT.

Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1?Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1?Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP: An Introduction to the Server-Side Scripting LanguagePHP: An Introduction to the Server-Side Scripting LanguageApr 16, 2025 am 12:18 AM

PHP is a server-side scripting language used for dynamic web development and server-side applications. 1.PHP is an interpreted language that does not require compilation and is suitable for rapid development. 2. PHP code is embedded in HTML, making it easy to develop web pages. 3. PHP processes server-side logic, generates HTML output, and supports user interaction and data processing. 4. PHP can interact with the database, process form submission, and execute server-side tasks.

PHP and the Web: Exploring its Long-Term ImpactPHP and the Web: Exploring its Long-Term ImpactApr 16, 2025 am 12:17 AM

PHP has shaped the network over the past few decades and will continue to play an important role in web development. 1) PHP originated in 1994 and has become the first choice for developers due to its ease of use and seamless integration with MySQL. 2) Its core functions include generating dynamic content and integrating with the database, allowing the website to be updated in real time and displayed in personalized manner. 3) The wide application and ecosystem of PHP have driven its long-term impact, but it also faces version updates and security challenges. 4) Performance improvements in recent years, such as the release of PHP7, enable it to compete with modern languages. 5) In the future, PHP needs to deal with new challenges such as containerization and microservices, but its flexibility and active community make it adaptable.

Why Use PHP? Advantages and Benefits ExplainedWhy Use PHP? Advantages and Benefits ExplainedApr 16, 2025 am 12:16 AM

The core benefits of PHP include ease of learning, strong web development support, rich libraries and frameworks, high performance and scalability, cross-platform compatibility, and cost-effectiveness. 1) Easy to learn and use, suitable for beginners; 2) Good integration with web servers and supports multiple databases; 3) Have powerful frameworks such as Laravel; 4) High performance can be achieved through optimization; 5) Support multiple operating systems; 6) Open source to reduce development costs.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools