In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the relevant interview questions of PHP". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the relevant interview questions of PHP"?
1. See that you have also used Go,Go in your resume. What are the differences and advantages between Go,Go and PHP when running?
A: PHP creates a fpm-worker process when each request comes in, resulting in the overhead of creating processes frequently in CPU when the system concurrency is high, while Go does not.
two。 You just talked about PHP, so since it is multi-process, how to share data?
A: since PHP is multi-process, the address and PCB space of process resources are independent, so there is no way to share data.
3. What can I do if I want to share data in Go?
A: I have used the collaborative program in the project, so I can use channel
4. So what is the essence and bottom of channel?
A: this knowledge point is a little vague. Let me see. If I remember correctly, I remember it is the pipeline of linux.
5. What are the characteristics of the linux pipeline?
A: the characteristic of the pipeline should be that it can only be written on one side and read on the other side. I wonder if my answer is correct.
6. Yeah, you're right, so what do you think the pipeline is made of?
A: I'm sorry, I don't know this question.
7. In fact, the pipeline is the file, and the operation of the file is to lock it.
A: yes, I remember. In fact, it involves the preemption of resources, and the preemption of resources by the system must be the realization of locking.
8. Since you also mentioned the cooperative process just now, can you describe the cooperative process principle of Go?
Answer: the Go protocol is based on the GPM scheduling mechanism of the CSP concurrency model. M can be understood that the processor CPU,P is used by the Go underlying layer to manage the Goroutine protocol.
9. (at this time the interviewer brings a blank piece of paper) write a binary search algorithm to have a look at it, using either PHP or Go
A: OK, I'll write it in PHP (PS: I'm using the recursive method here, so we should pay attention to the critical problem of binary search)
10. Well, the algorithm is fine. Ask me something about the network. Has socket ever used it?
A: websocket has been used, and long-term connections will be used in live chat rooms.
11. What protocol do you think websocket is based on?
A: it is based on the TCP protocol
How do 12.TCP clients and servers establish connection communication?
A: (ps: at first I got the wrong answer, I said ack, and the interviewer corrected it to be syn.) then I suddenly realized that the first step is for the client to send syn, the second step is for the server to reply to syn+ack, and the third step is for the client to reply ack.
13. How many times is the TCP handshake and how many times is it disconnected?
A: the handshake is three times and the disconnection is four times (ps: some interviewers will ask why it takes four times to disconnect. Here it involves a semi-connection waiting to be closed, but fortunately it didn't ask.)
14. Suppose we want to do one-to-one video chat, the daily DAU may reach hundreds of thousands, how to achieve one-to-one matching algorithm at the back end? Also, how to achieve a fast matching server without stress problems?
A: let me think about it. When users log in, if they do not start to match, they can be put into the set collection in redis and randomly selected through the SRANDMEMBER command. As for the value of redis, the maximum data can be kept at 512m, that is, in theory, we can carry tens of millions of users. As for keeping the high availability of redis, you can use rdb or aof to persist data. In addition, redis also has sentinel mode. If the main redis hangs up, you can also select the top of the redis server that is free.
Have you ever encountered master-slave delay synchronization when 15.mysql master-slave? How did you solve it?
A: emmmmm, I haven't encountered this situation yet.
16. You also know that we do social APP, if we want to do some interesting content or people, how will you achieve it?
A: you can use ElasticSearch. My previous project was used with ik Chinese word segmentation, but the disadvantage is that it eats machine memory.
Thank you for your reading, the above is the content of "what are the relevant interview questions of PHP". After the study of this article, I believe you have a deeper understanding of what the relevant interview questions of PHP have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.