Home > Backend Development > PHP Tutorial > Record the key points of mid-to-senior PHP interviews during the epidemic

Record the key points of mid-to-senior PHP interviews during the epidemic

藏色散人
Release: 2023-04-10 14:32:01
forward
8733 people have browsed it

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!

Related labels:
php
source:learnku.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template