I am a programmer with a bachelor’s degree but not a computer major. I met Ali last month, but failed. Then I met Meituan last week, and I finished the interview with HR last Friday.

Although his memory is not very good, but still recorded, hot face classics ah, there are some problems can not remember. The three technical aspects are as follows:

Beautiful group side:

I’m going to skip a couple of questions, because I don’t remember them, and I didn’t answer them very well.

1. Know SOA, microservices?

2. How does the distributed system load balance? How do I determine which server to access resources on?

One. Polling. 2. Random. Minimum response time. Minimum number of concurrent requests. Five. Hashing.

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

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

5. What problems will occur when HashMap has high concurrency? (Capacity expansion problem)

6. Describe what happens when you type a URL into the browser until the browser displays the page (I focused on DNS, then he went on to ask for DNS details, then ARP routing, then server processing, return, browser rendering, fetching HTML dependencies).

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

8. Add next pointer to all nodes of any binary tree.

Have you ever used a reverse proxy?

Meituan Second Side:

1. What are the ways to share memory between processes? (8)

2. In Linux, how do I check network port status (netstat) and memory usage (TOP)?

3. How to expand ConcurrentHashMap?

4. Do you know Java exceptions?

5. What happens if runtime exceptions are left unhandled? How should run-time exceptions be handled?

6, write code: give you 50 million ints, find the first 1000 largest number, 2 gb memory. At first I thought 50 million ints were a lot, and I forgot the conversion between G and byte. The way I do it is I maintain a small root heap of 1000, and I go through the array, and the total time is O (nlg1000).

7, give you n non-repeating integers, randomly find m non-repeating integers, the time and space complexity is O(m). (The method is very simple, just put the number in the back each time, just randomly access the array in the front, the time complexity is O(m), space complexity is O(1), but I didn’t think to put the selected ones in the back at first).

8, for SQL slow query optimization? (mainly from the query statement and database table design two aspects to consider, query statement can increase the index, increase the query screening restrictions; When the database table design can be divided into tables, design more fine-grained. But it turns out that what the interviewer is looking for is optimization of slow query questions that query a lot of data.)

9. What containers have you used? (Tomcat) Have you compared Tomcat to other servers? For example, nginx?

10. Have you used dynamic proxies? We’re going to use it a lot.

Three aspects of Meituan:

1. Introduce yourself and talk about the data flow in your project (draw a structure block diagram)

2. What books have you read?

3, talk about in-depth understanding of the JVM’s most impressive chapters (I talked about the JVM memory model, garbage collection, and class loading);

Added: what is stored in heap and stack? Where does static modification traversal exist? (Method area)

4. Tell me three things you remember most about Effective Java and what you understood about it

5. Which part do you think you are most familiar with (I said Java’s basic data structure)

6. What 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. What did you use it for? (Most used by Spring IOC)

What are the advantages of Spring? Principle of Spring AOP? How does Spring decouple?

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

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

14, write a list and an integer k (k is greater than or equal to 0, k is less than or equal to the length of the list, the length of the list is unknown). Invert the list in k steps (e.g. 1->2->3->4->5->6->7).

15, Mybatis is configured with XML, how to complete the database operation?

The interview summary

1. At least 3 years Java development experience or at least 5 years Internet development background

2. Familiar with spring MVC framework

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

4. Proficient in mysql application development, familiar with database principles and common performance optimization techniques

5. Familiar with distributed, cache, message search and other mechanisms, have distributed system development experience, cluster architecture design and user priority

Responsible, have ideas, love technology, like to study

7, have strong logical thinking ability, good at analysis, induction, fast positioning and solving problems

I can’t remember a lot of small problems. This is what I wrote down when I came back yesterday afternoon. I feel I have done my best.

I just received the notice from HR today that I have passed the interview, and I will be offered a formal offer this week. I quit my job in July and started to look for a job, so I have successfully completed the autumn recruitment this year. Finally, I wish every programmer who is looking for a job or is looking for a job can find their own satisfactory job. Come on, good luck will come sooner or later.

Although the winter was very cold this year, some of my friends went to BATJ and other Internet companies for interviews. They also sent me some Java interview questions, which are all about Ali P6 post. Today, I share these interview questions with you, hoping it will be helpful to you.

Pay attention to myClick here to get the document collection method

Hope to help forward this article!

Pay attention to myClick here to get the document collection method