Experience Sharing in the interview on the Meituan network and experience sharing in the interview on the Meituan Network

Source: Internet
Author: User

Experience Sharing in the interview on the Meituan network and experience sharing in the interview on the Meituan Network

Time: Thursday, October 11, September 25, 2014, about 1h40min, two sides: 40 min

Position: algorithm engineer of Meituan

Result: go back first!

Statement: don't like it, don't spray it, just for communication! We are dedicated to the rejected interview! If you know the answer to the question, please comment. Thank you!

I only blame myself for not learning well, and the road ahead is long, so it is far away!

On Thursday, September 25, 2014, I will go to the interview at ten o'clock A.M.. The interview will be conducted in a large classroom where you can sit on the right of an engineer. First, let's make a simple self-introduction. He will take a look at his resume by the way, then we enter the topic.

(Engineer A and engineer B and I)

A. are you interviewing android? Well, what are the following simple questions?

B.

What is the role of Intent in android?

B is used for jump between activities, and data transmission.

Aen. So what's the role?

B (just confess! Don't be confused.) In fact, android is not a very deep research. Actually, I use the most algorithms?

A. Is there an algorithm engineer in volunteer? Why not?

B. I thought it was very demanding, so I did not dare to fill it out, so I wrote it in the second volunteer !!! Bytes

A: Okay. I will ask the algorithm question. After that, I will transfer you to the algorithm engineer!

B Hao

A. What algorithms do you mainly study?

B. I usually study dp and games.

A game?

B en, mainly: backpack problems (01, full, multiple, two-dimensional charges, etc.), weizoboyi, nim games, SG theorem, and separated games.

A Let's look at A problem: A set of S1 (in total) consisting of 01 strings of n bits, finding out the set S composed of all homogeneous strings of A parent string, and S1 belongs to S.

Abstract:

For example, all 01 strings of n = 2 are: 00 01 1011

All the two-digit cyclic homogeneous strings of 0110 are: 01 11 10 00 meet the condition and cannot be found shorter, because at least two 0 and 1 are required. you can analyze how to find the shortest parent string!

B then thought about it. The length of the string should be at least> = 2n. It took about 5 minutes to think about it!

A. How do you solve programming? How can I find this string?

B construction?

A No. You should list all 01 strings of n bits and select them again!

B. Violent!

Aun

B: In this case, the complexity is () factorial.

The string A must contain n consecutive numbers of 1 and n consecutive numbers of 0. This can remove many cases and reduce the complexity.

B (speechless ,(!) You are so optimized, speechless)

A. Let's discuss the simple question:

How much memory can be recognized by a 32-bit operating system?

The theoretical value of B is 4 GB.

Why is A 4G?

B is 4 GB because the 32-bit encoded address space is 2 ^ 32.

A. How does the operating system allocate memory?

B starts from start?

Aun

B first, the computer powers up, the cpu directly sets the cs + ip address to the address of the first line of BIOS code, read the BIOS code ..... Until the desktop is started.

A Well, let's talk about how to divide each 32-bit int segment? Memory paging. What is the minimum segment?

Does B seem to be 15 characters long?

What is the offset of?

B, two places!

A okay, so ....

B (confess! Interrupt him.) I have not studied this!

 

A. Below are some questions:

How can I determine whether a single-chain table has a ring?

B thought for a moment, and the Hash clause is heavy. The efficiency of each query is O (1) and O (n). If the point that has accessed repeated access has a ring, if it is NULL, does it mean no loops?

A is good. What is the auxiliary space?

B O (n)

Can A not use the auxiliary space? Or use only the auxiliary space of O (1 ).

B. Let me think about it?

About 5 min ,.....

B seems to have no idea, because you have forgotten your path !! It seems hard to do it!

/*** Google later (spit it out: Since google encrypted search fields in the last few months, the related department wall has changed the local host file ), I found that google is the academic emperor, and the tortoise and rabbit algorithm !! (Also called speed pointer) stackoverflow has this problem !! We can also find the ring and efficiency O (n), and suddenly find that optimization is endless.

***/

 

A, let's look at the next question!

A strictly incrementing sequence is provided, which is divided into two segments from an unknown place in the middle. The first segment is placed behind it and the maximum value is obtained? Note that you do not know the split location!

B o (n) traversal is acceptable. I think you need a more efficient algorithm!

Aun

B drew a simple painting on the paper. thinking took about two minutes and found that thinking could be done in two places! I immediately gave the interviewer a thought!

A: Well, write the code to implement it.

B writes it at the beginning. After writing it, I found that L <R is a small problem and I didn't care about it!

A. The interviewer looked at it. Is there A problem with your border?

B (I can see it !) After thinking about 1 min, change it to L + 1 <min (a [L], a [R]) returned by R will be okay.

A, good.

A determines whether A binary tree is symmetric between the left and right sides of the root node!

B thought about how to traverse the tree, if "Left root right" = "Right and Left" is found, the system can determine whether it is "chiral symmetry" (a word seen in high school books ).

A. if A child is empty and A right child is NULL, then it is incorrect.

B: Add a-1 to the traversal sequence.

A (the interviewer drew A picture on paper )~~~ You can use this method, but you have to save the traversal sequence. Can you not use auxiliary space?

B (okay! I optimized the time and thought about space optimization. I usually only do the first one. I thought about it and traversed it!

A pair!

B, really! (Epiphany) Recursive Implementation, just compare the child each time! Four cases.

A. write the code.

B (okay, get used to it !) Starting from the next writing, I found that I did not write it, and I wrote it again. It took about 7 ~ 8 min, okay.

A. The interviewer looked at it, OK.

A. Let's look at another question: A binary tree that traverses layers! Write the code. If you want to record it and output it together.

B !) You can just traverse the BFS hierarchy.

... Write code

A, please wait!

B.

In about 5 minutes, the notification goes into two sides.

/---------------------------- I am the dividing line of edevil ---------------------------------------------/

/Users /--------------------------------------------------------------------------------------------------/

A. Let's give A brief introduction!

B, I'm from ...... (Introduction completed)

A. Let's discuss CS.

B. Sorry, I have never heard of CS?

A Computer Science (disdain)

B. Computer Science! (Khan)

A. After reading your resume, what algorithms do I study?

B (repeated again ...)

A Let's take A look at the question first: Is there A path from the upper left to the lower right corner of the black and white board? Only four upper and lower left positions can be accessed, and the path is white? Is it reachable?

B?

A No! Check whether it is reachable first?

B is BFS!

A. write the code!

B: About 6 minutes. Finish writing! Worst case, complexity O (n * m)

A. He saw the code in one line! It seems that no problem has been found. Why not output the path !!

B (dizzy! You did not say so early !) Get back the code, change it, and open a tag array, storage direction! Arrive at the end. You can trace the output from the end!

Can B be left blank! You have a loop! The maximum complexity is (n * m + n + m), but it only increases O (n + m). time complexity! The total time complexity has not increased !! (I really don't think it's so elegant. can I find a reason to be convinced )!

A is not the same. You can open the tag array! Can you find the path without repeating the loop!

B, recursive DFS. I wrote BFS!

Can A be recursive!

B. Change recursive DFS to non-recursive DFS. You have to enable the array record status!

A can not open arrays!

B is non-recursive. How to save the status without opening an array! (I feel more and more .....) (The voice is loud, and others think we are quarreling)

A. Let's change the question:

Now, there is an APK file on our server. You know it is a ZIP package. For every user request, first establish a connection, then judge the request source, and unpackage the apk, append the source information after the manifest, package it into an apk, and send it to the requester.

Q: 1. If multiple users request at the same time, there is no time difference, how can we solve the conflict?

2. How to improve data transmission efficiency?

B Singleton mode?

A singleton mode cannot be solved.

B. if multiple users request a request at the same time, you can create a request queue and then judge whether the request queue is empty or not. The requests in the queue are connected cyclically!

A. If two users' requests arrive at the same time!

B. Lock the file !!

A. If two requests request A lock at the same time?

B .... I am not very clear!

A. How can we improve the data sending efficiency based on the second question?

B needs to find the bottleneck first. Which efficiency is the lowest? I think the bottleneck should be on node forwarding! Spfa to find the shortest path!

A is not !!

B. The data is not controlled by the sender when it reaches the internet! That is, on the server side, packet group transmission?

A. How can I group it?

B. Isn't that a default score!

A, you can control it!

B OK! This is not very understandable!

A. Let's get here today! Go back first!

B (it is estimated that there is no such thing! Go back and study !)

B Singleton mode?

A singleton mode cannot be solved.

B. if multiple users request a request at the same time, you can create a request queue and then judge whether the request queue is empty or not. The requests in the queue are connected cyclically!

A. If two users' requests arrive at the same time!

B. Lock the file !!

A. If two requests request A lock at the same time?

B .... I am not very clear!

A. How can we improve the data sending efficiency based on the second question?

B needs to find the bottleneck first. Which efficiency is the lowest? I think the bottleneck should be on node forwarding! Spfa to find the shortest path!

A is not !!

B. The data is not controlled by the sender when it reaches the internet! That is, on the server side, packet group transmission?

A. How can I group it?

B. Isn't that a default score!

A, you can control it!

B OK! This is not very understandable!

A. Let's get here today! Go back first!

B (it is estimated that there is no such thing! Go back and study !)

Finally, I did not have a deep understanding of TCP/IP ....... I think all the explanations are so pale and powerless! I once again lamented that the book was used with little hate!

PS: I feel like I am only a few dregs in combat power. The revolution has not yet succeeded. comrades still need to work hard!

 

 


I called Meituan to ask about the treatment. If I got a phone call and did not have an interview, I asked about the treatment. What is wrong with me?

A truly competitive position will announce the benefits of the candidates. It may also be that the person is in a bad mood and does not want to talk more. His attitude is worse.

Meituan had no news after the interview. He said that there was a long wait for the news within three days. How did anyone go to the interview?

If they say it is three days, you will wait for three days. After three days, you will not be able to play the game. Occasionally, you will be notified after ten or half a month.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.