Original author named date
As a large number of students, I have a lot of units, there is successful, but all failures are a success in a sense, especially I wrote below. When I wrote this article, I have signed a software company in Nanjing, but I remembered this year's February 21, I interview Suzhou Taiwan's IT's experience Lenovo now.
I really have feeled in some cases of learning programming. This interview made me deeply experienced failure but also harvested a lot. I have to say it into three parts, 1. Yes
The specific passage of my interview 2. I think about the interview 3. I should do it today. Of course, these words are largely my personal opinions, it is impossible to completely agree, so
In some views, if a friend feels very large with me, please don't mind, don't attack me, just say that I have not said to discuss these issues! My email: wutao8@263.net
Interview
At approximately the interview notice of Taiwan Ruiqi, Realtek, the interview notice of Taiwan, inform me to the Suzhou Industrial Park interview, I took some majors in the next few days after receiving the interview.
The class is warm, especially the C and data structure. Due to the university, I have been specializing in these aspects, plus the adopted advanced programmer exam, for some common algorithms
I almost reached the point where I was familiar with the chest. At that time, if I asked me, I should have no problem!
On the 21st, I was arranged at 4:30 interview, and a technician gave me an interview. After asking some simple questions, he gave me a programming topic, the topic is like this:
(Because the topic of the specific interview is more cumbersome, I extract its core ideas to decompose into two independent simple questions. It is possible to decompose the problem. Please forgive, actually interview a problem but complicated, more complicated. And involving some higher mathematical transformations)
1) Write a function calculation When the parameter is N (N large), the value is 1-2 3-4 5-6 7 ... N
Hey, my heart is clear! I didn't expect it as simple, I am a little bit of a bit of a bit!
So I quickly 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 it! When I looked at the interviewer with the eyes of expectation, he smiled and said to me, the execution result is definitely no problem! But when N is big, my program is very efficient,
In the development of embedded systems, the operational efficiency of the program is important, which allows CPU to execute a directive. He let me see what can be modified in this program.
Optimize the program! After listening to these words, my mood became a bit heavy, I didn't expect his requirements very strict, and after I have strictly analyze the procedure, I have given improved programs!
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 don't dare to guarantee that this algorithm is optimal, but I have changed all statements involved in multiplication instructions to implementing the addition instructions than the previous program, which reaches the requirements of the topic.
The calculation time is shortened! And the cost is just an integer variable! But my current confidence has been hit, I will believe suspicuous people, he still smiles
Tell me: "Yes, this program is indeed a big improvement in efficiency!" I am in my heart! " But he will then say that this program still can't reach his request, I want to give better
Program! God! Also optimized! I really had a bit a bit a bit, I thought about it, I asked him to give his program! Then he gave his program very refreshing!
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, I didn't expect him to mean. I really can't write this simple code, but why don't I think it is not that? He said that there is no mistake, and the difference between the three procedures run is simply in the world when n is very large! When I just wanted to say something, he first opened: "Don't think that the CPU calculation speed will push all the questions to it, and the programmer should optimize the code and optimize the code. We can do it yourself. Never let the CPU do, because the CPU is serving users, not for us
Programmer service! "What brilliance, I don't want to say anything again! Next is the second question:
2). He requested that I use a skillful programming method to implement two functions of the two functions n as: 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 use a function fn (int N, int flag), when Flag is 0, implementation FN1 function, if FLAG is 1
Implement FN2 function! His requirements are still efficient, efficient, efficiency! To be honest, if I feel good, I should give a better algorithm, but I really don't have any thoughts.
Think about it, I went straight to the paper, such as 6! = 6 * 5! After straight, I said that he said that he gave him his answer! The interviewer did not say anything, gave his ideas:
Define a two-dimensional array float t [2] [5] to 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];
}
Finally get the calculated value! Oh, the algorithm of typical space change time!
These have spent 50 minutes, and I have a very casual chat with him. I have a problem with my programming and life. I am very relaxing.
Because I know that this interview result is only one: failed. At 5:30, the interviewer asked me to wait for us, so I left their company. This is the whole of the interview! 2. Through the interview
Really fails! I remember the big rain in that day, the temperature is very low, I think, I have been walking from 5:30 to 7:30, the whole body is wet, and I am cold and hungry, but I am just walking, my mind is full Doubt, I also want the rain to wake yourself! Seeing some friends here may think that if you don't make yourself, I will definitely believe in you, because I have never doubted Chinese programmers, I think China has the best procedures in China. Member, I have never thought that I have a master, so I can't do it. I don't mean that the Chinese programmer is poor than Taiwan or other places, so I am from my angle, I want to talk about some feelings:
Nice World has excellent programmers, China is no exception, but I doubt: What is the proportion of China and Taiwan or excellent programmers? Taiwan, I don't know, have a few of China's 100 programmers? I can't count, from the above performance is enough to explain everything! Is it 1? 5? 10? 50? I didn't dare to mess with this number, I was hurt by netizens, then how many people in our country learn computer? Take our school, 4 classes of the computer 97, 5 classes, 98 classes, 10 classes, 17 classes in 2000, more people, what should I do? Our school's practice is to let the graduate students, and then? After a big settlement, a lot of money fell into the pocket of the school, but also said that the current student is low! It's really funny, I don't know what the school is doing for what is to cultivate a lot of programmers in China? Can students really learn computer knowledge? Ok, I dare, in our school to learn programming students and outstanding programmers (note that I refer to excellent, only a few bad programs can be counted) should be 100: 0.1
In this proportion, although our Chinese learning programming people are covered, think about how many individuals can truly contribute to the development of China's software industry, how many people can truly write outstanding programs!
Since the study and programming, no matter whether it is self-study or the teacher's guidance, it has always solved the problem, and the program is coming, my doubts are: We have the truly emphasized the efficiency of the program, the quality of the program? We have a careful analysis of what we write, see if there is any way to improve, see if there is a simple way to achieve the same purpose? I asked, I found out that I have never optimized the procedure I wrote, up to DEBUG, but this is enough? These days I occasionally discovered a game I have written. It was a year ago, I just added it to one of them, I feel that I should take something out, then spend a week's time to write! The procedure is not complicated, but it has been used in a lot of data structures, and has used a wonderful algorithm, plus Windows interface and game playability. After writing a lot, I was really admired. Yourself! But now: No comment, a lot of ugly functions such as: void chushihua (), there is no necessary variable, you can use the simple statement to complete the work I use the gorgeous algorithm, a large number of global variables ....., If you say that you can listen, the more than 600 rows of procedures are a gap in addition to running! If I can hear some backspinses a year ago, I probably I can realize it, but since I heard since the original code, I heard the words of praise, no one filed me to improve the proceedings of procedures, this is What is the problem? Very worth thinking! There is also a doubt is: Is there really true? When I was in the school, I was assigned to a computer contest. I invited a teacher to go to the finals, mainly some algorithm topics, this teacher may be the only teacher in my university, from the program debugging to score, For each program, the time efficiency and space efficiency is taken carefully, then comprehensive score, forty people's rolls, and the teacher debugged from three o'clock in the evening, and after some written wonderful statements, I added annotation. I am so happy to have such a teacher and do an in-depth communication with him, but after the matter, I have a unpleasant thing, and I got the second student in the game to find me, saying that all the procedures were successfully debugged. He is full, and it should be first, I said he, finally tested his original procedure and the first original procedure comparison, good, both programs are running very well, then the classmate said: "My program is very simple, just the number of questions, but he wrote a lot, why gave him a lot of points." I was very angry, if not The teacher is responsible, then the first place and the second place really want to intermodize, please, the less the number of procedures, the higher the quality of the program, I remember that I talked to him this way, finally Convince him! Haha, but I can only talk about it, I don't know how many people have, saying that my head is a way, but I have never valued it!
3. I am going to do it!
In fact, I thought so much, but I didn't want to say anything, because I guess the netizens of this article probably have a belly feeling, a belly complaint, borrow this article, not what I want to achieve. I don't have a worthy of my own one, but I really do something wrong in some respects, or deviate from the right direction, now it is when it is correct and reorganized, just as I said in front. After that, I believe that China has the best programmers in the world, I also believe that my level will not always maintain the status, I will clean up the truth now! Really, I wrote this manual online when I wrote here. I don't know what this is foreplay, but I think if I have been doing the basic principle below, I will definitely realize my Ideal - A excellent software designer!
(The following text is not my original, I am I occasionally discovered online, I am really fortunate to see these, this article also ends with the following text, I sincerely hope you can come from this article. Get inspiration, this article welcomes everyone to reprint, you can write who the author is, but please write the original vCroad.Net original, thank you for your support)
Author: Kingdee Middleware CTO Yuan Honggang
I don't know that the software has been done ten years. There is a successful joy, but there is a painful pain, but I don't dare to say that I am a master, because I am more than the real master, it is too far away. There is no shortcut in the world, but some basic principles can follow.
1. Sound foundation. Data structure, discrete mathematics, compilation principle, these are the foundation of all computer science, if you don't master them, it is difficult to write high levels. According to my observation, people who learn computer majors can more written high quality software than others. The program will write, but when you find that it is difficult to write a certain degree, it should think about whether it is to go back to learn these most basic theories. Don't go to learn OOP at the beginning, even if you are fine, you may have no hand when you encounter some basic algorithms.
2. Rich imagination. Don't stick to a fixed thinking method. When you encounter problems, you should think about several solutions to solve the problem, try the way others have never thought about. Rich imagination is based on rich knowledge, except for computers, more about other disciplines, such as astronomy, physics, mathematics, etc. In addition, it is also a good way to see more sci-fi movies.
3. The simplest is the best. This may be a criterion following all sciences. Such complex quality interchange principles are just a simple formula that is simple in Einstein: E = MC2. A simple approach is easier to be understood, more easily implemented, and more easily maintained. When you encounter problems, you should give priority to the easiest solution, and only the simple solution cannot meet the requirements.
4. Do not drill the horn. When you encounter obstacles, you may wish to stay away from the computer, look at the scenery outside the window, listen to light music, chat with friends. When I encounter a problem, I will play games, and it is the kind of violent fighting game. When the part of the brain cells responsible for the game, the part of the brain cells responsible for programming have been fully resting. When I started working, I will find that the problem is now able to solve it.
5. The desire for the answer. The history of human nature science is a process of eager to get the answer, even if you can only know a small part of the answer, we pay for us. As long as you firmly believe, you must find the answer to the question, you will pay energy to explore, even if you don't get answers, you will learn a lot during the process.
6. More than others. Three people must have my teacher, maybe in a conversation with others, you can explore the inspirational spark. Many up-to-go, see what others' views on the same issue will give you a lot of inspiration. 7. Good programming style. Pay attention to develop a good habit, the indential arrangement of the code, the naming rules of the variable should always be consistent. Everyone knows how to exclude the error in the code, but often ignore the missed troubleshooting. Note is an important part of the program, which makes your code easier to understand, and if the code has clearly expressed your thoughts, you don't have to add any comments. If the comments and code are inconsistent, it is even worse.
8. Toughness and perseverance. This may be the "master" and general programmers the biggest difference. A good programming is 99 weat and 1ffee. Masters are not genius, they are hone in countless daysday night. Success can bring us extremely joy, but the process is incomparably boring. You may wish to do a test, find a number of items within 10,000, copy them all, then check three times, if you can complete this work, you can meet this.
These are a little experience in the programmer career in these years, I hope to help everyone.