


Record the key points of mid-to-senior PHP interviews during the epidemic
Due to the epidemic, it is a video interview. Party A’s lineup includes one HR supervisor and one product manager. The person directly responsible for this interview is Technical Director A. The other two seem to be heads of different departments (B and C) in the same position ( Well, they are all 35).
Without further ado, let’s get straight to the topic. (Some people want to use colons to separate them, but the colon key and tab on the keyboard seem to be broken)
At the beginning, hr introduced the members and positions involved in the interview, and then asked about his questions. The product manager asked Explain the reasons for Ben’s resignation and the issues he wants to know.
Then the real drama begins.
Director A: Seeing that you are very proficient in MySQL, please tell me about the isolation level of MySQL. .
Me: The isolation levels of MySQL transactions from first to highest are read uncommitted, read committed, repeatable read, and serialized. The default isolation level of MySQL is repeatable read, and transaction concurrency may cause The problem is dirty reading, non-repeatable reading, and phantom reading, and then the operations and solutions that cause these situations are explained respectively.
Director A: What is your strategy for modifying the isolation level in actual scenarios.
Me: .... (The ellipses here mean that I was making up some nonsense. In fact, I was a bit confused, because I have only processed tens of millions of traffic data, but it is not high concurrency, so it does not involve modifying isolation. sector, or the depth of thinking is not enough)
Director A: What are the indexes of innodb and how are they implemented.
Me: The primary key is a unique common joint index, which can be implemented by B-tree, B-tree, and hash.
Director A: What are the differences between these implementations? What strategies do you use to choose them when designing indexes?
Me: B-tree and B-tree are different in the data on leaf nodes and the depth of the tree. For the same retrieval, B-tree requires one more IO than B-tree. Choose different index algorithms according to the actual business scenario. If it is more reading and less writing, I will choose B-tree (actually I don’t know, because I forgot)
Director A: Classification and functions of MySQL locks , you use scenarios in actual work.
Me: (I was a little nervous at this time, because the previous interviews were from shallow to deep)... Then I briefly stated my understanding, but in fact the answer was not satisfactory. Because B and C also insert other questions.
Director B: Are you familiar with distribution? How to implement distributed locks? Have you ever learned about etcd?
Me: You can use redis's setnx combined with the expiration time to implement this, because I have implemented this in my business before, etcd, and I have never understood this (I don't have this concept in my mind). Also,, (interrupted )
Director C: Time is limited, let’s continue with other questions. Let’s see if you have done PHP optimization and how to use opcahche.
Me: (thought for a moment), opcode parsing and optimization.
Director C: Where is the opcode
Me: I have no impression of this, (I really have no impression of this) Because based on the business scenario before, I have made a qualitative improvement in the project from the front end, CDN, server reverse proxy, database cache, and program logic code optimization, but it is the only thing that I don’t have contact with opchache and opcode. , mistake)
Director C: Briefly describe the process of url, just focus on the key points
My browser inputs the url and parses it into an IP, and then sends the request to the web server. If it is nginx It will be sent to PHP-FPM through cgi, and then wait for the PHP script to parse, process logic, and respond to data.
Director C: What is cgi and what is it used for?
Me: cgi is a protocol, which is a protocol for languages like PHP to communicate with web servers.
Director B: What is the architectural model of PHP-FPM and how have you optimized it?
Me: It is a master (main)-worker (worker process) architecture model. It is the work process that actually processes requests. The master mainly manages and recycles child processes. If optimized, it has been changed before. I will briefly describe the configuration of its number of processes: Due to the static mode configured before, the default number of processes was 200. Later, when there was a certain concurrency, I should change it to the "third" configuration mode and configure the specified number. There is a minimum and maximum value for the number of processes (the maximum value is actually forgotten here, I just think there must be no limit, after all, hardware resources are the ceiling), and then dynamically increase the number of processes based on the actual number of requests.
Director B: Are there any other optimizations?
Me: (I was silent for a while. In fact, I made other changes during the revision, but I really forgot about it. I felt that this interview was stretched. ), I did do other optimizations at that time, but I can’t remember them.
Director B: Tell me about the rabbitmq you use and your understanding of it.
Me: (Briefly describing the architecture of rabbitmq) and my usage scenarios and business.
Director B: Tell me about the topic mode you use
Me: (I briefly described the topic usage process, which is considered a pass).
Director A: Let’s talk about redis sharding.
Me: Sharding is the process of dividing keys into multiple redis instances, which uses the memory and CPU processing power of multiple computers to improve,,,,
Director A : How to implement the ranking list
Me: You can use the ordered set of redis, because it has a score,,,
Director A: Use that function to get the value
Me: (Recalling it, I really can’t remember it) I forgot this, what kind of member function.
Director A: Let’s talk about AOP, have you used it?
Me: AOP aspect programming is to use dynamic proxy and other technologies to achieve unified maintenance of functional modules, a bit like laravel’s facade (I don’t know) At the end of the day, if you think about it, it will fail).
Director A: Let’s talk about the characteristics of hyperf
Me: Based on swoole, a plug-in high-performance and highly flexible coroutine framework. It is containerized with dependency injection, aop mode, and annotations. Mode, event mode,,,
Director A: Let’s talk about the coroutine pool and coroutine state management
Me: (I didn’t actually answer it here. In fact, after thinking about it, I can still Answer part, at least coroutine state management can be answered)
Director A: If you know go, this question is very simple
Director A: Let’s talk about laravel
me : (This is my strong point, so I won’t briefly describe it one by one)
Director B: Let’s talk about Linux and shell scripts
Me: (Brief introduction to Linux and common commands and vi), shell expressions and variable definitions and uses are different from PHP language.
Director C: I see you use map reduce to batch data, tell me about it
I use monogo’s map redcue to process data,,, (interrupted)
Director C: I thought I would use hadoop’s map reduce
Director A: Tell me about your plans for the future
Me: …
The above is my time The video interview was 100% restored. Later, when I thought about it carefully, I found that many of them had solutions. But why was the effect of this interview so inconsistent? The rhythm. Yes, it was the rhythm. It was the interviewer who gave me "deep" stuff, which disrupted my rhythm.
Related recommendations: "PHP Video Tutorial" " PHP Interview Questions Summary (Collection) "
The above is the detailed content of Record the key points of mid-to-senior PHP interviews during the epidemic. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.
