Interview and summary

Source: Internet
Author: User

I went to Baidu building for an interview today. I am a test and Development Engineer (summer internship). The interviewer is a beautiful and friendly JJ.

The first one is very simple.ProgramThere are several data zones in it. What is the difference between the stack and stack?

The second method is to merge two ordered arrays (which may be ascending or descending) into a large array so that they are still ordered. The general idea is explained and implemented in C.Code

The third way is to give two numbers of int Type X and Y. It is required that the values of x and y be exchanged without using the third variable,

Ah. I learned C from my freshman year. I used value-based parameter passing, reference-based parameter passing, pointer-based parameter passing, macro-defined Interchange (X and Y), but they all used auxiliary variables, this is the first time that JJ exchanged X and Y with no third variable, my God... The first reaction was choppy, but I felt very fresh and curious.

JJ also seems to have seen that I won't, so he said: You should first think about it, write it on paper, try to write itAlgorithmCode. Ah, I have never met you, but the 7th feeling immediately tells me that this algorithm is certainly not difficult, but it is very skillful. It may be a sharp brain turn. When I come up with it, I will suddenly become very cheerful. Unfortunately, I am only here at the moment, no

So far, I put aside pointers, references, and so on. I want to use logic operations such as XOR, reverse, and intersection, and draw comparisons like limit 1 and limit 10, poor, I couldn't figure it out at half past one, So JJ prompted me to think about a mathematical operation. So I thought about the triangle calculation, subtraction, multiplication, division, and so on, it makes up a four arithmetic operation (x + y) and (x-y), so I can't figure out how to do it next, in addition, I suddenly encountered this simple problem, which could not be a simple problem, but was not fixed. Then, the heart of Baidu's virgins jumped so badly that I was sitting in the central air-conditioning building, it's like an ant who fell into the hot pot-sweating. It's so hot that day. Haha, JJ saw it, so he skipped it.

The fourth question is 1.txt00002.txt .... For N files in n.txt, you must find the file containing the string "love" and return the file name. It was too easy for me to get started with the shell command find + grep. Poor JJ asked me to write pseudocode in advanced languages. So I whispered to JJ, can I use library functions, she said yes. OK directly Str. substring () or split () in strcmp. jj seems not satisfied with the result. It seems that the efficiency is too low. Ah, I want to compare it with a char directly, but it is too troublesome and efficient.

The fifth question is to let me test a vending machine. I think baidu should only test the program, so I did not say to test physical features such as buttons, power supplies, coin notes, etc, I jumped directly to the logic part of the test program, and used the equivalent division method, boundary value analysis method, and empirical evaluation method. I also talked about three intervals: forced withdrawal of money, normal shopping, and continuous congestion of money after shopping, then, where the boundary value test and Experience Test on both sides of the normal shopping are often prone to errors, JJ looked at me, did not speak, continue ..

After the sixth question, there will be some conceptual questions, such as the four conditions of the deadlock and the way in which processes communicate (I only want the four channels, messages, global variables, and semaphores) empty machine testing (Jj seems to have read down dang machines into empty Kong machines, but I didn't respond at the time, and I didn't have to worry about the downtime of the two servers in my management lab. Poor, I didn't know at the time that she might be down. Ah, the response was really not agile enough. So JJ asked me why I didn't understand it. I said I never met an empty Host, so JJ will not ask again)

I remember that JJ was talking very kindly and very nice to others. Finally, JJ asked me what I was doing. I had a close heart and I had a close relationship with X and Y. So my first question was to ask JJ How to exchange the values of X and Y without variables. JJ smiled and left me as a "homework". Let me go home and check it myself, now, I suddenly realized that my ideas were different or mathematical addition and subtraction operations. Now I am reading them online. Suddenly, I am very open. I just want to say three simple words, Khan (I went back to the lab after the interview that afternoon, I completed my homework interview and summary on Baidu in four ways, but I don't know if I have the chance to submit my homework on Baidu ). JJ asked me another question. I was very interested in the glittering space capsule behind me. So I asked jj what the space capsule was doing. Jj said it was a rest, and liked Baidu's sleeping place, so dreamy and cute-the glowing space capsule, haha ^_^. JJ looked at me with curiosity and smiled again: Maybe it's just like laughing at my childish child, baidu first met over LA; I checked the mobile phone time, and booked the interviewer five minutes in advance from to. It took only 49 minutes to sign in and leave after, it also includes time for going upstairs, going downstairs, walking, and chilling. Let's see if ggjj is still interviewing. JJ is doing things very well, like

 

Huhu, the overall feeling is that the interview questions are not very difficult, but the consideration and description were not very clear at the time. The easyest questions of X and Y all of a sudden, short-circuited my mind and wiped out my self-confidence.

 

Come on, let's wait. Whatever the outcome, you can go to Baidu for an interview. It's worth this trip to Baidu to meet so friendly, competent, and smart JJ.

 

========================================================== ==============================================

Here is a picture of the Baidu headquarters. Let's keep it as a souvenir and goal for the interview.

 

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.