What happened during the interview

Source: Internet
Author: User

It is nearly two years after graduation. From the very beginning of the program writing, there are only a handful of companies interviewed. The old man said that he would like to expand himself in the battle. It seems that my experience is far from enough. However, in the limited struggle, I also summarized a little bit and shared it with everyone.
Some problems are too tricky. If you are too immersed in these clever tricks, but it hurts yourself, it is better to put your energy into a more effective place. However, some people still like to investigate such problems, just like Kong Yiji, who is quite proud to know several methods of returning words.
I boast that I am a C ++ programmer, so here I will probably write some questions about C ++ that I encountered during the interview.
1. Key points about polymorphism and object-oriented
As an object-oriented programmer, this question must be clarified. on the Internet and in textbooks, it is a standard answer. The key is to understand the meaning.

2. virtual function tables and rtti 
This inside C ++ object model is quite clear.
The first item in the virtual function table is about rtti. rtti is run time type identification.
The following is the virtual function pointer.
 
3. Memory layout of C ++ objects
After introducing virtual functions, inheritance, multi-inheritance, and virtual inheritance, coupled with memory alignment, this problem is not that simple.
 
4. constructor, destructor, and virtual functions
A series of problems, as a C ++ programmer, must be clarified.
 
5. default parameters of virtual functions
Code estimation can better describe the problem:
Class
{
Public:
Virtual void function (INT type = 0 ){...}
}
 
Class B: public
{
Public:
Virtual void function (INT type = 2) {...} // note that the default value of type is changed to 2.
}
What's the problem with this change?
We know that virtual is dynamically bound. For efficiency consideration, the default parameter is statically bound. As a result, problems will occur in the above practices.
If you can use static binding and dynamic binding to solve this problem, you have taken the next step. I have never used it like this. I don't know where the problem is. Some articles have said that C ++ programmers who have never suffered hardships are not good programmers and cannot tame C ++ !?
 
6 about Operators
Overload problems, operators and functions
 
7. New and delete forms
I have also written a blog to talk about this.
 
8. Private inheritance
I don't know how many people have used it and how many benefits it has. Some languages have already banned private inheritance. What is the significance of entanglement.
 
9 iterator of STL
STL has many good ideas, but I have not been asked, such as traits programming techniques. For interviews, the efficiency of the front and back sides of ++ is common.
 
10 C ++ exceptions
C ++ has an exception handling mechanism. Although it is not well-developed, it should be understood carefully.
 
11 efficiency of C ++ and C
The most difficult question is the comparison of efficiency, what is the environment, and what are the prerequisites, in terms of language, the main Efficiency Loss of C ++ compared with that of C language comes from the non-direct calling caused by virtual. This inside C ++ object model is quite clear.

About reading

Several books that must be read by C ++ programmers, including the inside C ++ object model and Objective C ++, have never been read by the effective series, I can only say that I am not using many of the above errors, so I cannot remember them.
Inside C ++ is a good book worth studying many times. It is strongly recommended.
To cope with the c ++ interview questions, read the valid C ++ series twice and remember the above terms. Basically, there is no problem. (You will find that there are many problems in this book)

What is the root of programmers?

There are too many things outside of the language, such as data structures and algorithms. Of course, they are not just memorizing, but learning ideas. I always believe that this is a thousand times more important than the language stream.

Like the design model, I have become more and more admired for it. These are the foundation of development. If you cannot use them, it basically means that you are doing valuable work, and it is difficult to improve it effectively. Let's take a look at it and plan it.
It is difficult to list other special items, such as networks and operating systems.
 
Finally, during the interview, remember not to say uncertain words like this. Otherwise, it will be regarded as uncertain words, and you will be suspected and asked questions as uncertain words, then you say "no.

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.