Home  >  Article  >  Backend Development  >  Summary of PHP interview knowledge points

Summary of PHP interview knowledge points

不言
不言Original
2018-07-14 11:41:381547browse

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