Summary of high-frequency test points for technical interviews-C++ articles


Summary of high-frequency test points for technical interviews-C++ articles

Hello everyone, this is Xiaodai!

In the technical interview, in addition to examining some basic computer knowledge , the examination of language mastery is also a very large part of the interview. So, today I will introduce the content that must be tested in the basic part of C++ in the interview. Bar.

You can use this summary of the compulsory content to check for gaps and check your C++ mastery .

As usual, let me first introduce some of the content of this series:

Some features of this summary are:

1) Close to the interview : almost 100% of the problems encountered in the interview;

2) Concise and practical : It will not cover all aspects, but will include the most important knowledge and the most frequently tested knowledge under each topic.

3) Do not give official standard answers : On the one hand, you can test your own mastery, and on the other hand, you can remember more deeply in actively searching for answers.

Past content of this series:

Summary of high-frequency test points for technical interviews-computer network articles: https://mp.weixin.qq.com/s/13oOfB0z4C1wQc301TcLdQ

Summary of high-frequency test points for technical interviews-MySQL articles: https://mp.weixin.qq.com/s/n_lK4P7jF35ow39e3XhHtQ

Tips: Although this test site summary will not give answers, but in the follow-up basic computer knowledge, C++, JAVA, computer networks, operating systems, design patterns, data structures and algorithms, Redis, MySQL, JS, A detailed version of stereotyped essay PDF on CSS, VUE, HTML and other knowledge topics, including questions and detailed answers to questions, including answers to questions in this push series, and answers to questions in some test sites with high test frequency. Among them, the back-end knowledge is sorted out by me, and the front-end knowledge is sorted out by a front-end boss ~ it is already being sorted out!

Let's start now~

1. Enumeration of C++ Common Test Test Sites

Let's start to introduce the basic C++ questions that must be tested in the interview ~ the questions listed below are all questions I was asked in the interview

1) Talk about the difference between C++ and golang, Python, java, C and other languages

2) How to understand C++ object-oriented programming, and talk about the difference between object-oriented and process-oriented

3) How to understand encapsulation, inheritance and polymorphism in C++

4) Compile-time polymorphism and runtime polymorphism

5) What is a static member, a static member of a class, how to assign a value

6) In inheritance, the execution order of constructors

7) How to know which class an instance belongs to?

8) How to avoid external instantiation of objects of this class

Constructor privatization, abstract classes, interfaces, C++11 =delete

9) How many bytes does an empty class in C++ occupy?

10) What is blank base class optimization

11) What are the default functions of an empty class in C++, please write the function definition

12) Introduce the memory partition

13) The difference between the heap area and the stack area

Development and release, application speed, how to store

14) What is memory fragmentation

15) What are smart pointers?

16) Is shared_ptr thread-safe?

17) Method of forced type conversion

18) C++ exceptions, list the exceptions, can there be exceptions in the constructor, can there be exceptions in the destructor

19) Introduce when stack overflow and heap overflow will occur

20) The method of passing parameters to the function

21) Introducing constructors and destructors

22) Should the destructor of the parent class be set as a virtual function, and why?

23) How virtual functions are implemented

Memory layout, evolution of virtual function table (single inheritance, multiple inheritance)

Virtual functions are the most frequently investigated issues

24) What is diamond inheritance and how to solve it

25) What is the this pointer and what is its use? Is there a this pointer in the struct?

26) Where is the this pointer stored

27) The most essential difference between struct and class

28) The difference between typedef and define

29) The difference between const and define, when const cannot replace define

30) The difference between const int * and int const* and int* const

31) How to assign an exclusive smart pointer

32) How does a lambda expression receive external parameters

33) Introduce the C++11 features you have mastered

34) rvalue reference

35) The method of accessing the value of map in C++ is not only []

36) The difference between begin() and cbegin() in iterators

37) What is the difference between resize and reserve of vector

38) How to clear the memory occupied by vector, how to clear the size, how to clear the capacity

39) vector expansion mechanism

40) The delete element iterator is invalid, what about different types of containers

41) The difference between vector container and list container

42) The difference between set and map

43) The difference between [] and insert in map

44) The principle of red-black tree, query complexity (average, worst)

45) How to implement C++ multithreading, which library to tune

46) How does multi-threading ensure thread safety

47) What should be paid attention to when designing an interface, and what is a good interface

Easy to inspect in state-owned enterprises

48) Code conversion process from source code to executable file

49) Dynamic linking and static linking

50) Big endian, little endian, network byte order, host byte order

2. C++ basic recommended learning materials

Searching for C++ learning routes on the Internet, I believe there are many, many and comprehensive ones, and the writing is also very good. Here is a simple one. Based on my own experience in learning C++, I recommend some courses and books~

1. Video lessons

If you are a 0-basic computer novice, it is recommended to watch the C++ course of the dark horse programmer

The characteristic of this set of courses is that it is very basic, very simple, and has no difficulty. It is very suitable for beginners with zero foundation to get started with C++

If you have a certain foundation, I recommend watching Hou Jie’s C++ course

2. book

The most recommended is "C++ Primer"

This book is really very good-looking. Almost all C++ grammars can be explained in detail in the book. At the same time, it is not difficult and can be eaten with video lessons.

The following three books are also recommended. A tricky way is that if you find a certain problem in the interview questions and don’t understand it very well, you can flip through the following books to understand it in depth. Remember to explore the C++ object model in depth The virtual function part is very detailed.

《Effective C++》

"STL source code analysis"

"Deep Exploration of the C++ Object Model"

3. Summary

Ok, so far, the introduction of the required C++ basics is finished. It mainly lists the C++ questions that I was asked in the interview, and finally gave a little bit of courses and books recommended by Xiaodai~

The original intention of this series is to give you the fastest way to get started with the technical interview. After going through the questions, you can kill the basic questions of the technical interview. If you want to read more, you can leave a message

I hope it can help everyone~

Guess you like

Origin blog.csdn.net/qq_46046431/article/details/129854026