The newly released Meituan three-sided R&D post, see how I can successfully get an offer

Warm face, the Meituan I met yesterday, although I finished my HR face, I don’t feel much hope. I hope I can get the offer with luck. The three technical aspects are as follows: One


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

1. Know SOA, microservices?

2. How to load balance the distributed system? How to determine which server the accessed resource is on?

1. Polling. 2. Random. 3. Minimum response time. 4. The minimum number of concurrent. 5. Hash.

3. Design a distributed load balancing buffer system, how to quickly locate which server (using key segmentation, consistent hash)

4. How to ensure strong consistency between the buffer and the database (using locks)

5. What problems will occur in the case of high concurrency of HashMap, (capacity expansion problem)

6. Talk about what happened after entering a url in the browser until the browser displays the page (I mainly talked about DNS, and then he asked about DNS details, then ARP routing, and then the server processed , Return, browser rendering, get dependent resources in html)

7. Reversal of the sentence in the string (such as ABC DEF, output DEF ABC) (very simple, you can reverse the entire string first, then reverse the word, or first split the sentence into words and then reverse);

8. Add next pointers to all nodes of any binary tree (this has the original question, you can also refer to printing binary tree by layer).

9. Have you used a reverse proxy?

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, and the restriction conditions of query filtering can be increased; 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? I will use it frequently in the future

Three sides:

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 JVM (I talked about the JVM memory model, garbage collection and class loading);

Supplement: I also asked what is stored in the heap and stack? Where does static modified traversal exist? (Method area)

4. Tell me about the three most impressive items and your understanding in "Effective Java"

5. Which one do you think you are most familiar with (I said the basic data structure of Java)

6. Then you talk about the internal implementation of HashMap;

7. Is HashMap thread safe? (No, ConcurrentHashMap is)

8. How is ConcurrentHashMap implemented internally? What data structure is each segment? (HashTable)

9. What technologies are used in your project? (Spring)

10. Tell me about what you used it? (Spring IOC used most)

11. What are the advantages of Spring? The principle of Spring AOP? How does Spring achieve decoupling?

12. Do you understand the linked list? (Did I say List?) Yes, (understand ArrayList and LinkedList), what about the difference between them?

13. Will you exchange the two nodes of the linked list? (Is the linked list reversed?) Yes, you write code to achieve it.

14. 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, the length of the linked list is unknown), and the linked list is reversed by k steps (such as 1->2->3->4- >5->6->7, when k=3, the result is 3->2->1->6->5->4->7)

15. Tell me how to complete database operations after mybatis is configured with xml?

to sum up

  1. More than three years of java development experience or more than five years of Internet development background

  2. Proficiency in using springmvc framework

  3. Master object-oriented design and development, familiar with common design patterns

  4. Familiar with mysql for application development, familiar with database principles and common performance optimization techniques

  5. Familiar with distributed, caching, message search and other mechanisms, have experience in distributed system development, cluster architecture design and user preference

  6. Have a sense of responsibility, have ideas, love technology, like to study

  7. Strong logical thinking ability, good at analyzing, summarizing, locating and solving problems quickly

I can't remember a lot of small problems. This was recorded when I came back yesterday afternoon, and I feel that I have tried my best.
Finally, I was lucky to get the offer. I wish all friends who are still looking for a job can find their own satisfactory job. Come on, good luck will come sooner or later.

I deliberately sorted it out. There are many questions that cannot be explained clearly by a few sentences. I have removed some documents here. The answers to many questions are actually very simple, but the thinking and logic behind them are not simple. That's why. If you need Java engineering, high performance and distributed, high performance, explain the profound things in a simple way. Friends of performance tuning, Spring, MyBatis, Netty source code analysis can:
———— Click here directly and reply the code: CS can be obtained directly! ! !

Guess you like