Record recent interviews (PHP)

Time:2021-3-2

Make a note of the interview questions that you have encountered recently. The companies are not big, so they only pick out some technical problems to record.

PHP foundation related:
  • How to compile PHP? Do you know anything about opcode? From the perspective of opcode, can you optimize the speed of PHP?
  • How to implement PHP variable bottom layer?
  • How does nginx communicate with PHP FPM? What is the difference between nginx listening port and socket mode? How does PHP FPM call PHP code?
  • How does PHP connect to MySQL? How is connection pooling implemented?
  • Talk about the difference between PHP and golang
  • What is the difference between the coroutines in spool and go?
  • The underlying implementation of goruntine in go? How does the coroutine in go communicate?

Functional correlation

array_ key_ Exists () and in_ Which performance of array () is better?

Code related:
  • Let’s talk about the code architecture of the project you wrote? (MVC, transformer, middleware, etc.)
  • Common design patterns in laravel (in addition to dependency injection and control inversion, we also ask about policy pattern and decorator pattern)
  • Composer automatic loading mechanism (psr-4)
Database (MySQL)

The commonplace are: common optimization methods, why to use B + tree storage, index type, isolation level and so on.

  • Now there are joint indexes a, B, C, usingselect * from table where c=1 and a=2Can a and C be indexed separately? Why?

  • Only use Mysql to solve the problem in high level

  • Using recursion in MySQL

    A pen test, feel more partial, as supplementary knowledge to understand

  • How to deal with slow MySQL execution? What information usually appears in the extra field of explain? If you see in explain that SQL has been indexed, but the execution is still slow, what will be the reason?

    using filesort、mmr、using index condition、using index、using where

    There are several reasons why the index is still slow

    • When the current SQL statement is executed, MySQL is just cleaning the dirty page
    • There are no fields to query in the secondary index tree, so you need to go back to the table (it should be noted that MySQL optimizer will stop using the index when it needs to go back to the table, and when the number of rows scanned by the back table is too large, it will go directly to the primary key index, and then there will be no going back index in the extra field)
    • The amount of data in the data table is too large, so it needs physical optimization such as sub database and sub table
  • When to lock exclusive locks in MySQL? Can you manually add and exclude other locks?
  • What’s the difference between MyISAM engine and InnoDB? What are the advantages of MyISAM?
  • How to solve the delay of MySQL master-slave?
Redis and NoSQL
  • The difference between redis and mongodb
  • Concepts and solutions of redis cache avalanche, breakdown and penetration
  • How do redis sentries communicate with each other?
  • What if the number of redis connections is used up?
  • What’s the difference between consistent hashing and hashing?
  • Delay queue (this is asked through a solution, the problem is how to delay sending SMS or e-mail)
  • How to ensure that a user request of an interface can only be requested once a second?

    The lock in redis is used

operating system
  • The difference between thread and coroutine
network
  • Session sharing

This work adoptsCC agreementReprint must indicate the author and the link of this article

Recommended Today

Third party calls wechat payment interface

Step one: preparation 1. Wechat payment interface can only be called if the developer qualification has been authenticated on wechat open platform, so the first thing is to authenticate. It’s very simple, but wechat will charge 300 yuan for audit 2. Set payment directory Login wechat payment merchant platform( pay.weixin.qq . com) — > Product […]