search
HomeBackend DevelopmentPHP TutorialRecord 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!

Statement
This article is reproduced at:learnku. If there is any infringement, please contact admin@php.cn delete
What are some common problems that can cause PHP sessions to fail?What are some common problems that can cause PHP sessions to fail?Apr 25, 2025 am 12:16 AM

Reasons for PHPSession failure include configuration errors, cookie issues, and session expiration. 1. Configuration error: Check and set the correct session.save_path. 2.Cookie problem: Make sure the cookie is set correctly. 3.Session expires: Adjust session.gc_maxlifetime value to extend session time.

How do you debug session-related issues in PHP?How do you debug session-related issues in PHP?Apr 25, 2025 am 12:12 AM

Methods to debug session problems in PHP include: 1. Check whether the session is started correctly; 2. Verify the delivery of the session ID; 3. Check the storage and reading of session data; 4. Check the server configuration. By outputting session ID and data, viewing session file content, etc., you can effectively diagnose and solve session-related problems.

What happens if session_start() is called multiple times?What happens if session_start() is called multiple times?Apr 25, 2025 am 12:06 AM

Multiple calls to session_start() will result in warning messages and possible data overwrites. 1) PHP will issue a warning, prompting that the session has been started. 2) It may cause unexpected overwriting of session data. 3) Use session_status() to check the session status to avoid repeated calls.

How do you configure the session lifetime in PHP?How do you configure the session lifetime in PHP?Apr 25, 2025 am 12:05 AM

Configuring the session lifecycle in PHP can be achieved by setting session.gc_maxlifetime and session.cookie_lifetime. 1) session.gc_maxlifetime controls the survival time of server-side session data, 2) session.cookie_lifetime controls the life cycle of client cookies. When set to 0, the cookie expires when the browser is closed.

What are the advantages of using a database to store sessions?What are the advantages of using a database to store sessions?Apr 24, 2025 am 12:16 AM

The main advantages of using database storage sessions include persistence, scalability, and security. 1. Persistence: Even if the server restarts, the session data can remain unchanged. 2. Scalability: Applicable to distributed systems, ensuring that session data is synchronized between multiple servers. 3. Security: The database provides encrypted storage to protect sensitive information.

How do you implement custom session handling in PHP?How do you implement custom session handling in PHP?Apr 24, 2025 am 12:16 AM

Implementing custom session processing in PHP can be done by implementing the SessionHandlerInterface interface. The specific steps include: 1) Creating a class that implements SessionHandlerInterface, such as CustomSessionHandler; 2) Rewriting methods in the interface (such as open, close, read, write, destroy, gc) to define the life cycle and storage method of session data; 3) Register a custom session processor in a PHP script and start the session. This allows data to be stored in media such as MySQL and Redis to improve performance, security and scalability.

What is a session ID?What is a session ID?Apr 24, 2025 am 12:13 AM

SessionID is a mechanism used in web applications to track user session status. 1. It is a randomly generated string used to maintain user's identity information during multiple interactions between the user and the server. 2. The server generates and sends it to the client through cookies or URL parameters to help identify and associate these requests in multiple requests of the user. 3. Generation usually uses random algorithms to ensure uniqueness and unpredictability. 4. In actual development, in-memory databases such as Redis can be used to store session data to improve performance and security.

How do you handle sessions in a stateless environment (e.g., API)?How do you handle sessions in a stateless environment (e.g., API)?Apr 24, 2025 am 12:12 AM

Managing sessions in stateless environments such as APIs can be achieved by using JWT or cookies. 1. JWT is suitable for statelessness and scalability, but it is large in size when it comes to big data. 2.Cookies are more traditional and easy to implement, but they need to be configured with caution to ensure security.

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

Video Face Swap

Video Face Swap

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

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function