Meituan Java post face sharing (four aspects of technology): Spring + JVM + multithreading + algorithm + design

 

Meituan Java post face sharing (four aspects of technology): Spring + JVM + multithreading + algorithm + design

 

 

Meituan I submitted my resume online on Lagou. I also voted once before, but my resume did not pass the selection. Later, I asked my sister to help me change my resume and re-invest in another department to get an interview. At noon on October 23rd, HR called to make an appointment at 4:30 in the afternoon and said that I would write the code online so that I could prepare the network environment. As a result, the pigeons were released before 5:30. After re-channeling with hr, I decided to meet again next Monday afternoon, but communicating with hr to make an appointment seems to be of little use in the US group.

Meituan technical side 20 minutes

At 7pm, because I wanted to interview next Monday, I was just about to go out and play badminton, and the Beijing phone came. The interviewer was sorry, saying the meeting was delayed.

1. Self-introduction

I have said it many times, and it is very smooth to pick up the key points.

2. Ask me if the data structure algorithm is good

Very good (in fact, my heart is still a bit imaginary, but recently I have brushed a lot of questions and I can only be brave to be fat)

3. Find the trisection point of the singly linked list, if the singly linked list has a ring

Use the fast and slow pointers, one for one step and one for three steps. If there is a ring, first determine where the ring is, find the last node, and then use the previous ringless method

4. Talk about the project structure

I focused on MVC

5. Tell me about the familiar design patterns

I focused on singletons, factory methods, agents

5. Have you configured a server?

I really do n’t know this. I have n’t heard of it. I can only honestly say no.

I was in a hurry, I guess the interviewer had not eaten just after the meeting. He said let me wait, maybe find another colleague to meet me, maybe tell me the result directly. Judging from the interviewer's voice and tone, I judged that he must be the head of the department, and the design of the question was too much. Later, hr told me that he was the head of the department I was going to. Haha.

Meituan technique on both sides for 60 minutes, detailed Q & A

After the meeting, I was about to go out to play badminton, and the phone in Beijing came again. (It's doomed not to participate in the team's activities this Friday!) Two sides: Compared with one side, the voice of the two-side interviewer sounds like it is engaged in technology development, and as expected, an hour of pure technical telephone interview! The face is particularly comprehensive!

1. Spring: Have you used Spring, Spring IOC, AOP mechanism and implementation, Spring MVC

In fact, I really don't want to be asked about the details of Spring. I didn't remember the framework without reviewing it. So I said to the interviewer that I understand some of the more important mechanisms in Spring. I understand it well. Then I used a practical example to explain my understanding of IOC and AOP. He heard it right and understood it well. Go to an interviewer who can give feedback while interviewing, so happy)

I have actually used Spring MVC. I told the interviewer about the Servlet, jsp and javabean implementation of MVC used in my project, as well as the responsibilities of each module of MVC and how each module is linked together. Finally I added One sentence I think the idea of ​​SpringMVC is actually the same as this (he is right, hey hey feedback is really good)

2. Multithreading: how to achieve thread safety, what is the difference between the various implementation methods, the use of the volatile keyword, the understanding of reentrant locks, whether Synchronized is reentrant locks

Here I mainly talk about the Synchronized keyword, as well as some locks under the concurrent package, as well as their advantages and disadvantages and differences. The volatile keyword I mainly talked about in terms of visibility, atomicity, and prohibition of JVM instruction reordering. Let me talk about the use of the volatile keyword in the multi-threaded singleton mode double-check to prohibit JVM instruction reordering optimization. .

3. Collection: the underlying implementation of HashMap, how to achieve HashMap thread safety

I talked about the bottom of HashMap is the implementation of array plus singly linked list, Node internal class, add process, Hash conflict resolution, expansion, three collection views. The implementation of HashMap thread safety mainly talks about the static methods SynchronizedMap in HashTable, ConcurrentHashMap and Collections can encapsulate HashMap. And the difference between these three ways, efficiency performance.

4. JVM memory management, GC algorithm, garbage collector in HotSpot, class loading

JVM memory is mainly divided into five areas, which are shared by threads, which are exclusive to threads, and what is stored in each area. GC: How to determine which objects need to be GC, GC method, Minor GC and Full GC. HotSpot GC algorithm and 7 kinds of garbage collection period, mainly talked about CMS and G1 collector. Class loading: class loading process, Bootstrap classloader-ExtClassloader-AppClassloader, parent class delegation mechanism.

5. The difference between process and thread

Answered from four aspects: scheduling, concurrency, resources and system overhead.

6. There is no state for HTTP, I said stateless, how to solve HTTP stateless ? How to solve HTTP stateless is actually how to track the session, there are four methods: URL rewriting, hidden form fields, cookies, Session.

7, Java IO, NIO, whether there is asynchronous IO in Java

Java IO implements synchronous blocking, how does it implement synchronous blocking. I took the read () method as an example. NIO implements synchronous non-blocking. I talked in detail about the select () method poll in Selector to show how it implements multiplexed IO. Then compare their efficiency. The interviewer may see that I know more about this piece, and then continue to ask me if there is asynchronous IO in Java. I feel like it does not, but the interviewer said yes, let me think about it. In fact, I am not clear here, so I I talked to the interviewer about my understanding of the asynchronous IO model in Unix, and then I do n’t really know if there is any Java. (He actually laughed! Said your understanding is right, is it not important in Java! Haha)

8. Will the front end, what is Ajax, Ajax implementation principle

I just use some js for the front end. I used the jquery framework and asked me what the full name of Ajax is. I guess it is asynchronous js and xml. In fact, I do n’t understand the principle of Ajax. I just talked about it asynchronously querying through the XMLHttpRequest object. The Ajax engine runs on the client, reducing the workload of the server.

9. Let me design a thread pool

Because I wrote in my resume that I understand multithreading and concurrency better. So he always asks questions in this regard. This problem because I have seen the source code of ThreadPoolExecutor before, so I will follow the design idea of ​​that class. I will talk about the core pool and the creation of threads in a factory method pattern. The thread pool state, blocking queue, These aspects of the rejection strategy. The design is fairly comprehensive.

10. Talk about several design patterns, where are they used, and why are they used?

Singleton mode, getRuntime () in jdk; factory method mode, ThreadFactory for ThreadPoolExcutor; Observer mode: Observable and Observer under java.util package. Finally, I mainly talked about the usage scenarios of the factory method pattern.

11. Mysql optimization and index implementation

I talk about database design optimization and query optimization. Index B + tree implementation, the difference between the implementation of InnoDB and MyISAM primary key index, one aggregation and one non-aggregation.

12. The isolation level of the transaction

Four isolation levels, what exceptions may occur, the default level in mysql.

13. Have you used Hibernate, mybatis, git

This is just a brief talk, what are they doing?

*14、Linux *

I said that this undergraduate had been used, but it was useless for a long time, and the order was forgotten. He said it ’s okay, I ’ll test you a few simple ones: cd, ls, dir (really simple)

15. Algorithm question

Find the smallest 10 out of 100,000, time complexity analysis (maximum heap, consider memory)

Find the maximum sum of consecutive sub-arrays from a positive and negative array, time complexity analysis (dynamic programming)

How many nodes are there on the i-th layer of the full binary tree, and how many nodes are on the n-layer full binary tree

It's finally time for me to ask questions

1. What department are you (he said is the core department, big data R & D)

2. I am very interested in high concurrency and load balancing, but I usually do not have this environment in school to let me experience in this area, then you suggest how I can learn it now (he said it is really not very easy to learn , You can only read some theories and other people's blogs, you can learn slowly in the future)

3. What does middleware do specifically to solve the problem of high concurrency and load balancing (he said almost yes, then he said that our department is not a middleware, but a big data department, I said, I know)

In the end there was no problem, he kept me on the phone.

After all this, with a dry mouth, I once suspected that he might not know that I was applying for an intern position. There is too much to summarize, let's put it together in the summary.

Meituan technique on three sides for 25 minutes

The interviewer said that he was from another department and needed a cross interview.

1. MySql optimization

2. Say what the project has done, architecture and the like

3. Write the code online on collabedit. The title is very simple. It is the original question of the beauty of programming. An ordered array of integers. Output two numbers so that their sum is a given value. I wrote it before and wrote it quickly, and then gave him ideas. He continued to ask what to do if the array was unordered, sort first.

4. Two files, each file has several urls, find the same url in both files (using HashMap)

This is very simple, just add the online code writing link that has not been interviewed before. Collabedit later I learned that some Internet companies like Facebook will use this online editor to write code in remote interviews, which is written in text documents, without prompts, and cannot be compiled. Run the same as writing on the whiteboard. Just practice your hands.

Meituan Technology HR 30 minutes on all sides

The three-face interviewer said that he was the final face and said that I would wait for hr to contact me. I never imagined that the hr surface half an hour later was actually technical.

1. Introduce yourself, have you introduced yourself on all sides? ! I thought it was a simple hr face, so I introduced my personality and life, but the result is not.

2. Ask the project, the questions are particularly detailed, the technical details, and what problems are encountered, how to solve them, whether anyone takes the project, and how to communicate with others.

3. Database optimization, how to do database optimization if a table in the database is very big

4. Ask the research subject of the graduate student, why did you choose this topic, what papers did you read (finely asked me which papers those papers were published in, and which school the author is), why did you choose this algorithm, how to optimize How does the experiment result compare with others, and why is it better than others' algorithms (one question after another keeps coming up, I guess he should not understand those professional terms I just said, just judge whether I did it ...)

5. Determining the internship time really makes me feel oppressive. The project was done by an undergraduate. It has been a long time, and some technical details are not too summed up, so I can only ask the editor to ask the editor, hehe. It's okay in scientific research. I was doing this last semester. I still remember the realization and improvement and comparison of some algorithms. The answer is quite smooth. Maybe this is really the technical hr side.

Take this to share the interview materials I have collected and some of my architectural video materials over the years!

 

Meituan Java post face sharing (four aspects of technology): Spring + JVM + multithreading + algorithm + design

 

 

Meituan Java post face sharing (four aspects of technology): Spring + JVM + multithreading + algorithm + design

 

 

Meituan Java post face sharing (four aspects of technology): Spring + JVM + multithreading + algorithm + design

 

 

Why some people are always better than you, because he is very good and has been working hard to become better, and are you still satisfied with the status quo and happily in the heart! After likes and follow, then the little cute You can click here to get free Java architecture learning materials (including high availability, high concurrency, high performance and distributed, JVM performance tuning, Spring source code, MyBatis, Netty, Redis, Kafka, Mysql, Zookeeper, Tomcat, Docker, Dubbo, Nginx and other knowledge points of structured video learning materials and e-book materials) reasonably use each minute and every second to learn to improve yourself, and do n’t use "no time" to cover up your laziness in thinking! While young, work hard and give yourself an account of the future!

Published 238 original articles · Like 68 · Visits 30,000+

Guess you like

Origin blog.csdn.net/qq_45401061/article/details/104699302