Interview experience and experience of a senior student

Source: Internet
Author: User
Tags comments data structures printf
As a senior student, I interviewed a lot of units, there are successes have failed, but for me all the failure in a sense is a success, especially I write below these, when writing this article, I have signed a software company in Nanjing, But think of February 21 this year I interviewed Suzhou Taiwan's IT company's experience Lenovo we now learn some of the situation of programming I really have feelings, this interview made me deeply feel the failure but also reaped a lot.


What I'm going to say is divided into three parts,
1. It's the exact interview I've been through.
2. The interview was thought of
3. What I should do today.
Of course these words to a large extent is my personal opinion, it is impossible to fully agree with everyone, so in some points of view if a friend feel that there is a great discrepancy with me, please do not mind, do not attack on me, when I did not say, welcome and I contact to discuss these issues together. My email:wutao8@263.net.

1. Interview after
About a year ago I received Taiwan Rui Sheng (Realtek) Suzhou Company interview notice, notify me February 21 to Suzhou Industrial Park interview, received after the interview a few days after I have some specialized courses to review, especially C + + and data structure, because of university years, I have been specifically research these aspects, Plus passed the senior Programmer's exam, for some commonly used algorithms I almost reached the point of the chest, then the feeling is if asked me these aspects of the problem I should be no problem.

On the day of 21st I was scheduled to interview at 4:30, by a technical staff to interview me alone, after asking some simple questions, he gave me a programming topic, the topic is this:

(Because the specific interview topic is more cumbersome, I extracted its core ideas to break down into ... Garbled

1) Write a function to calculate the value when the parameter is n (n Large) 1-2+3-4+5-6+7......+n
Hum, my heart sneer at a sound. I did not think so simple, I am a little nervous in the mood immediately relaxed up.
So soon I gave my solution:

LONG fn (long N)
{
Long temp=0;
int i,flag=1;
if (n<=0)
{
printf ("error:n must > 0);
Exit (1);
}
for (i=1;i<=n;i++)
{
Temp=temp+flag*i;
Flag= ( -1) *flag;
}
return temp;
}

Get. When I looked at the interviewer with a look of anticipation, he smiled and told me that the result of the implementation was certainly no problem. But when n is very big I this program execution efficiency is very low, in the embedded system development, the program running efficiency is very important, can let the CPU executes one instruction to be good, he lets me see this program also has what can modify the place, the program optimizes a bit. Listen to these words, my mood at that time changed a bit heavy, did not think his request is very strict, after I have a rigorous analysis of the procedure, gave the improved plan.

LONG fn (long N)
{
Long temp=0;
int j=1,i=1,flag=1;
if (n<=0)
{
printf ("error:n must > 0);
Exit (1);
}
while (j<=n)
{
Temp=temp+i;
I=-i;
i>0?i++:i--;
j + +;
}
return temp;
}

Although I do not guarantee that this algorithm is optimal, but compared to the previous program, I have all the statements involving the multiplication instruction to execute the addition instruction, both to achieve the requirements of the topic and the computation time shortened a lot. The price is simply to add an integer variable. But now my confidence has withstood a bit of shock, I am skeptical of the interviewer, he smiled and said to me: "Yes, this program really has a great improvement in efficiency." "I have a anxi in my heart. But he went on to say that the program still failed to meet his requirements and asked me to give a better plan. Oh, my God. There is also optimization. I was really a bit of a wreck, and after a while, I asked him to give his plan. Then he gave his program very readily.

LONG fn (long N)
{
if (n<=0)
{
printf ("error:n must > 0);
Exit (1);
}
if (0==n%2)
Return (N/2) * (-1);
Else
Return (N/2) * ( -1) +n;
}

Funny, I was stunned, did not expect him to mean, so simple code I really do not write it, but why I did not think about it. There's nothing wrong with what he said, but the difference between the three-program run times when N was very big. When I was about to say something, he first said: "Do not think that the CPU is fast enough to push all the problems to it to do, programmers should optimize the code optimization, we can never do to let the CPU do, because the CPU is for the user, not for our programmers to serve." "What an incisive language I have not wanted to say anymore." Then there is the second question:
He asked me to use a technical programming method to implement the functions of two functions with a function N for example:

FN1 (n) =n/2!+n/3!+n/4!+n/5!+n/6!
FN2 (n) =n/5!+n/6!+n/7!+n/8!+n/9!

Now implemented with a function fn (int n,int flag), when flag is 0 o'clock, the FN1 function is implemented, if flag is 1 o'clock fn2 function. His demands are efficiency, efficiency, efficiency. To be honest, if I am in a good mood, I should be able to give a better algorithm, but I really did not have any thoughts at that time,
I made some random calculations on the paper, such as 6!=6*5! 's formula, and told him bluntly to give him his answer. The interviewer did not say anything, giving his ideas:
Define a two-dimensional array float t[2][5] deposit [2!,3!,4!,5!,6!},{5!, 6!, 7!,8!,9!] Then give a loop:

for (i=0;i<6;i++)
{
Temp=temp+n/t[flag][i];
}

Finally, the calculated value is obtained. Hehe, the typical space-time-change algorithm.
It took a total of 50 minutes and 10 minutes to talk to him casually, to talk about programming and life problems, and I was relaxed because I knew there was only one result: failure. 5:30, the interviewer asked me to wait for the notice, so I left their company. This is the whole interview.

2. From the interview thought

It's really a failure. I remember that day under the great rain, the temperature is very low, I walk and think, from 5:30 to 7:30, the whole body is soaked, cold and hungry, but I just keep walking, the mind is full of doubts, I also want to let the rain to wake up. See some of the friends here may think that the interview questions are not what if you can do it all correctly, I certainly believe you, because I have never doubted the ability of Chinese programmers, I think China has the best programmers in the world, I have never thought I was a master, So I can't do it. It doesn't mean that Chinese programmers are worse than programmers in Taiwan or elsewhere,
In my opinion, from my point of view, I want to talk about some thoughts:

Well, there are good programmers all over the world, and China is no exception, but I wonder what the ratio of good programmers in China to Taiwan or abroad really is. Taiwan I don't know, how many of the 100 programmers in China are good? I'm not at all, it's enough to show everything from above. is 1. 5 of them. 10 of them. 50 of them. This number I dare not to guess, fear of netizens a scolding, then we have how many people in the country learning computer it. Take our school, computer 97 Class 4 classes, 98 Class 5 classes, 99 Class 10 classes, 2000 class 17 classes, more people, how to do the teacher. Our school practice is to let graduate students to class, and then. Retake a catch a lot, a lot of makeup fee into the school's pocket, also said that the current learning
quality low. It is funny, I do not know what the school is doing for the sake of cultivating a large number of programmers in the country. Can the students really learn computer knowledge? Well, I dare say, in our school to learn programming students and excellent programmers (note I mean good, only a few bad programs are not counted) proportion should be 100:0.1 at this rate although we in China to learn programming people overwhelming, but think how many people can really contribute to the development of China's software industry, How many people can really write good program names overseas.

Since I learned programming, whether it is self-study or teacher guidance, has always been to solve the problem is good, the process of compiling the line, my doubts are: we have a real emphasis on the efficiency of the program, the quality of the program. We have carefully analyzed what we write, see if there is any improvement, and see if there is a simple way to achieve the same goal. I asked myself, I found out that I had never optimized the program I had written, at most it was a detailed test and then debug, but that was enough. These days I occasionally find that I have written a game, it is a year as one of the time, feel that should take something out, and then spent one weeks to write out. The program is not complicated,
but the use of a lot of data structure of things, but also used a number of wonderful algorithms, plus the Windows interface and game playability, after writing has been a lot of praise, I really admire myself. But now look: there is no comment, a lot of ugly function names such as: void Chushihua (), a lot of unnecessary variables, can be done with a simple statement I use a gorgeous algorithm, a lot of use of global variables .... More than 600 lines of programs can be run The
is a piece of crap. If I could hear a few negative comments a year ago, maybe I could have awakened a little earlier, but since the original code had been heard in the website since it was published, no one had suggested to me the improvement of the program, which would explain the question. It's worth thinking about.

There is another question: are we talking and doing the same thing? When I was in school has been assigned to host a computer competition, invited a teacher to the final title, mainly some algorithm topics, this teacher may be my only teacher admired since the university, from the program debugging to scoring, for each program is carefully analyzed its time efficiency and space efficiency, and then comprehensive scoring, 40 People's Test paper, the teacher from three o'clock in the afternoon to 10 o'clock, in some of the wonderful statements added after the comments. I am really happy to meet such a teacher and do in-depth communication with him, but in the event, but there was an unpleasant thing, in the race to get the second student to find me, said that his program all the debugging success should give him full marks, and should be the first, I said but he, finally pulled out his original program and first place the original procedure , two programs are running very well, at this time, the classmate said: "My program is very simple and clear, just a few lines to complete the topic requirements, and he wrote a lot, why give him more than the points to me." "I was very angry, if not the teacher is responsible, then now the first and second position really want to intermodulation, please, not the program number of fewer lines program quality is higher, I remember I talked with him about this truth, and finally persuaded him. Haha, but I, can only say, I do not know how many people like, said it is well-known, but the heart has never paid attention to it.


3. What I'm going to do.
In fact, I think of the day far more than so much, but I do not want to say, because I guess the netizen who read this article probably have belly feelings, belly complain, borrow this article vent is not I want to achieve the purpose, in the above I scold the worthless is not self-belittle, but in some aspects I really do wrong , or deviated from the right direction, now is the time to rectify the direction and rally, as I said before, I believe that China has the best programmers in the world, I also believe that my level will not always keep the status quo, I now pick up the real work of discontent. Really very coincidence, I wrote here when I found this book on the Internet occasionally, I do not know what this heralds, but I think if I follow this basic principle has been steadfast to do, I will achieve my ideal---a good software designer!

(The following text is not my original, is I occasionally found on the internet, I am really lucky to see these, this article also with the following text and end, I sincerely hope you can get inspiration from this article, this article welcomes the free reprint. )

Author: Kingdee Middleware company CTO Shangong Gang

Unknowingly do the software has been done for ten years, there is the joy of success, but also have the pain of failure, but always dare not call himself a master, because and my mind real masters than up, still poor too far. The world has not been a shortcut to master, but some basic principles can be followed.

1. A solid foundation. Data structures, Discrete mathematics, and compilation principles are the foundations of all computer science, and it is difficult to write high-level programs without mastering them. According to my observation, computer majors are more able to write high-quality software than others who study other majors. The program is written by everyone, but when you find that writing to a certain degree is difficult to improve, you should think about whether you want to go back and learn the most basic theories. Do not learn oop from the start, even if you are proficient in oop, you may be helpless when you encounter some basic algorithms.

2. A rich imagination. Do not stick to the fixed way of thinking, when encountering problems, you should think of several solutions to solve the problem, try others never thought of methods. Rich imagination is based on a wealth of knowledge, in addition to computers, more into other disciplines, such as astronomy, physics, mathematics and so on. Besides, it's also a good way to see more sci-fi movies.

3. The simplest is the best. This is perhaps a guideline that all science follows, and the principle of such complex mass-energy swaps is simply a simple formula: e=mc^2. Simple methods are easier to understand, easier to implement, and easier to maintain. When encountering a problem, prioritize the simplest scenario, and consider a complex scenario only if the simple scenario does not meet the requirements.

4. Not to the dead. When you encounter obstacles, you may want to temporarily away from the computer, look out of the window scenery, listen to light music, and friends chat. When I have a problem, I go to play games, and it is the violent fight game, when the part of the brain that is responsible for the game is extremely hyper, the part of the brain that is responsible for programming is getting enough rest. When I start working again, I will find that these problems can be solved now.

5. The thirst for answers. The history of human science is a process of craving for answers, even if only a small part of the answer is worth the effort. As long as you firmly believe, you must find the answer to the problem, you will devote energy to explore, even if you do not have the answer, in the process you will learn a lot.

6. Communicate more with others. Three people will have my teacher, perhaps in a casual conversation with others, you can burst the spark of inspiration. It will give you a lot of inspiration to get on the internet and see how people think about the same problem.

7. Good programming style. Pay attention to develop good habits, code indentation orchestration, variable naming rules should always be consistent. Everyone knows how to rule out errors in the code, but often ignores the mistakes in the comments. Annotations are an important part of a program that makes your code easier to understand, and if your code has clearly expressed your thoughts, you don't have to annotate them, which is even worse if the comments and code are inconsistent.

8. Toughness and perseverance. This may be the biggest difference between a "master" and a general programmer. A good programming is weat and 1ffee. Experts are not geniuses, they are honed in countless days and nights. Success can bring us incomparable joy, but the process is extremely dull. You might want to do a test, find a list of primes within 10000, copy them all down, and then check three more times, and if you can do this without interruption, you can meet this one.
 
These are my years of experience in the programmer's career, I hope to be helpful to everyone.

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.