3 years of Java development, Meituan has now joined the three sides, sharing experience: basic + algorithm + Spring source code + MySQL + distributed

Although I don't have a good memory, I still recorded it, and there were some problems I couldn't remember. The three technical aspects are as follows:

Meituan side:

I omitted about a few questions in the middle, because I don't remember them, and I basically didn't answer them well below what I remember.

  1. Understand SOA, microservices?
  2. How to load balance the distributed system? How to determine which server the accessed resource is on?
  3. 1. Polling. 2. Random. 3. Minimum response time. 4. The minimum number of concurrent. 5. Hash.
  4. Design a distributed load balancing buffer system, how to quickly locate that server (using key segmentation, consistent hash)
  5. How to ensure strong consistency between the buffer and the database (using locks)
  6. What problems will occur in the case of high concurrency of HashMap, (capacity expansion problem)
  7. Talk about what happened after entering a url in the browser until the browser displayed the page (I mainly talked about DNS, and then he asked about the details of DNS, then ARP routing, and then the server processed it and returned. , Browser rendering, get dependent resources in html)
  8. Reversal of sentences in a string (such as ABC DEF, output DEF ABC) (very simple, you can first reverse the entire string, then reverse the word, or first split the sentence into words, and then reverse);
  9. Add next pointers to all nodes of any binary tree (this has the original question, you can also refer to printing binary trees by layer).
  10. Have you used a reverse proxy?

Meituan two sides:

  1. What are the ways to share memory between processes? (8 types)
  2. How to check the network port status (netstat) under linux, how to check the memory usage (top)?
  3. How to expand ConcurrentHashMap?
  4. Do you know the exception of java?
  5. What happens if the runtime exception is not handled? How to deal with runtime exceptions?
  6. Write code: Give you 50 million ints, find the largest number in the first 1000, and have 2G of memory. (At first I thought that 50 million ints are a lot, and I forgot the conversion of G and byte. Later, the interviewer's guidance only remembered. My method is to maintain a small root heap of 1000, and then traverse the array. The overall time complexity is Is O (nlg1000))
  7. Give you n non-repeated integers and randomly find m non-repeated integers, requiring both time and space complexity to be O(m). (The method is very simple, that is, every time the extracted number is put to the back, only random access in the front array is enough. The time complexity is O(m) and the space complexity is O(1), but I just started Did not expect to put the selected ones behind).
  8. For the optimization of SQL slow query? (It is mainly considered from the two aspects of query statement and database table design. In query statement, indexes can be added to increase the restriction conditions of query filtering; the database table can be split when designing, and the design can be more fine-grained. But later discovered What the interviewer wants is to optimize the slow query problem of querying large amounts of data.)
  9. Which containers have been used? (Tomcat) Have you compared the difference between Tomcat and other servers? Such as nginx?
  10. Have you used a dynamic proxy? Will be used frequently in the future.

Three sides of Meituan:

  1. Introduce yourself, talk about the data flow in your project (draw the structure diagram)
  2. What books have you read?
  3. Talk about the most impressive chapters in the in-depth understanding of the JVM (I talked about the JVM memory model, garbage collection and class loading);
  4. Supplement: I also asked what is stored in the heap and stack? Where does static modified traversal exist? (Method area)
  5. Talk about the three most impressive things and your understanding in "Effective Java"
  6. Which one do you think you are most familiar with (I said the basic data structure of Java)
  7. Then you talk about the internal implementation of HashMap;
  8. Is HashMap thread safe? (No, ConcurrentHashMap is)
  9. How is ConcurrentHashMap implemented internally? What data structure is each segment? (HashTable)
  10. What technologies are used in your project? (Spring)
  11. Tell me what did you use it for? (Spring IOC is most used)
  12. Advantages of Spring? The principle of Spring AOP? How does Spring achieve decoupling?
  13. Do you understand the linked list? (Did I say List?) Yes, (understand ArrayList and LinkedList), what about the difference between them?
  14. Will the two nodes of the linked list be exchanged? (Is the linked list reversed?) Yes, you write code to achieve it.
  15. Write another one, giving you a linked list and an integer k (k is greater than or equal to 0, less than or equal to the length of the linked list, and the length of the linked list is unknown), press k step
  16. Reverse linked list (such as 1->2->3->4->5->6->7, when k=3, the result is 3->2->1->6->5->4- >7)
  17. Talk about how to complete database operations after mybatis is configured with xml?

Interview summary

Share the high-frequency interview questions (including answer analysis) that I have collected and summarized by myself, hoping to help fans and friends get their favorite offers.

Fans and friends who need to get the above interview information, after one-click three consecutive

 

Guess you like

Origin blog.csdn.net/bjmsb/article/details/114636760