Junior students are dissatisfied with the meituan internship. They switch to the headlines and find out six customs clearance experience, Java post

Keywords: Java Back-end Interview

Today, I'd like to share with you the interview process of a friend who went to today's headlines (a junior undergraduate student who is currently interning in meituan).

The following is his journey, which is divided into six links:

If you want to climb the peak, don't use the rainbow as a ladder.

1. Self introduction

After a brief self introduction to his situation, the interviewer asked if he had any requirements for the working language (because I was a Java technology stack).

How to introduce yourself and how to write a resume are prepared in advance. Don't wait for your head to heat up on the spot. It's best to recite it again, but don't let the interviewer think you're reciting it.

2. Chat project

Interviewer: tell me about the project you are most familiar with, what technology stacks are used, and what challenges have you encountered in the project?

Then, I chose a project I was working on recently, introduced the technology stack used in the whole project, what the business was like as a whole, encountered some problems, and then solved them by some means.

Then, the interviewer asked some technical questions about the project, as follows.

Why decentralization?

What do you think are the advantages and disadvantages of microservices?

The benefits of decentralization?

How does distributed ensure consistency?

How to ensure consistency after single point of failure, unavailability and data loss?

Why use RocketMQ? MQ selection

You say RocketMQ is better for small-scale projects. Why? Why do you think it fits with the Java technology stack?

Kafka vs. RocketMQ? The relationship between message magnitude and MQ latency has been discussed for a long time

How does MQ ensure that messages are not lost?

How does MQ guarantee idempotency of messages? No repeated consumption

How to ensure the order of messages sent by multiple nodes through MQ?

Asked a vector clock, do you understand?

Briefly talk about the whole process from a java source file to garbage collection

How to select a garbage collector?

Talk about the relationship between stack and thread in JVM

What JVM troubleshooting tools are you familiar with?

3. Operating system

Four questions were asked about the operating system:

Familiar with process scheduling strategy?

Talk about CFS?

What is friendliness?

How was it calculated?

4. Computer network

What guarantees TCP reliable transmission?

In addition to three handshakes and four waves, how to ensure reliable transmission in the process of data transmission?

What are the most basic requirements for communication? (maybe the interviewer wanted to remind me, but I didn't get it very well)

Requirements for point-to-point communication? Basic features? (it's hard to get what the interviewer wants to ask me)

Later, I learned that I wanted to ask about TCP ARQ, sliding window, congestion control, flow control, timeout retransmission, etc.

5. Handwritten SQL

Table 1: student table student(no {student number}, name {name}) table 2: grade table grade(no {student number}, grade {grade}, subject {subject}) give a student's name and calculate the student's grades in each subject:

When writing here, the no and grade columns were reserved. The interviewer asked why he wanted No. later, he knew that he wanted to put the subject into the result...

6. Algorithm

Single linked list inversion

Enter a linked list. After reversing the linked list, output the header of the new linked list.

Input: {1,2,3}

Output: {3,2,1}

There are two solutions to this problem. Please see the code:

//The first method is non recursive
struct ListNode {
 int val;
 struct ListNode *next;
 ListNode(int x) :
   val(x), next(NULL) {
class Solution {
    ListNode* ReverseList(ListNode* pHead) {
        if(pHead==NULL) return NULL;//Pay attention to program robustness
        ListNode* pNode=pHead;//Current pointer
        ListNode* pReverseHead=NULL;//Header pointer of the new linked list
        ListNode* pPrev=NULL;//The previous node of the current pointer
        while(pNode!=NULL){//Execute only when the current node is not empty
            ListNode* pNext=pNode->next;//Before the chain is broken, the node behind the broken position must be saved
            if(pNext==NULL)//When pNext is empty, it indicates that the current node is the tail node
            pNode->next=pPrev;//Pointer reversal
        return pReverseHead;

//The second method is recursive method 
struct ListNode {
 int val;
 struct ListNode *next;
 ListNode(int x) :
   val(x), next(NULL) {
class Solution {
    ListNode* ReverseList(ListNode* pHead) {
  //If the linked list is empty or there is only one element in the linked list 
        if(pHead==NULL||pHead->next==NULL) return pHead;
  //First reverse the following linked list and go to the end node of the linked list
        ListNode* pReverseNode=ReverseList(pHead->next);
        //Then set the current node as the subsequent node of the subsequent node
        return pReverseNode;

The recursive method is actually very clever. It uses recursion to go to the end of the linked list, and then updates the next value of each node to realize the inversion of the linked list. The value of newhead has not changed and is the last node of the linked list. Therefore, after inversion, we can get the head of the new linked list.

Pay attention to the common considerations about linked list problems:

1. If the input header node is NULL, or the whole linked list has only one node

2. Consideration of chain list fracture


After reading the interview above, do you think it's difficult?

The answers to the above questions can be found in my interview notes, so there is no need to post the answers in the article.

Interview transcript address:


Posted by sKunKbad on Thu, 04 Nov 2021 03:57:16 -0700