C + + interview notes

Source: Internet
Author: User
Tags message queue

Pointers, polymorphism (virtual function table, memory layout), scope, memory management

Algorithm and data structure, data structure by mastering hash, priority queue, algorithm has string processing, simple DFS, BFS, dynamic planning

System knowledge, process, thread, association, lock usage, message queue, shared memory, network protocol, Epoll,select, etc. The problem is that, by hashing, the operation is serialized through a queue. will be combined with the project you have actually done to ask questions, wrote a Web Server,key-val database, through the Redis source code, you can combine the system knowledge to check, to confirm is not really understand these things, is not really absorbed;

--------------------------

From Zhihu chencw2ly

C + + knowledge, C + + features, polymorphism, virtual functions, vector and list implementation principles

Multithreading-related, such as high concurrency, communication, and then there is something related to the lock;

Database aspects mainly have, commonly used SQL statements, how to improve the performance of the database, MySQL and Oracle features.

Network communication aspect: mainly is the TCP/IP and HTTP,TCP/IP several handshake, the simple client service side realization, the HTTP mainly is the HTTP protocol the thing, like the HTTP format, important has the get/post difference

Linux will ask a few common commands, such as viewing a process, producing a network, modifying permissions, gcc-related things,

If the answer is not good, the whiteboard will be programmed.

Suggestion: Fresh students, multi-brush problems, written test results, good to run.

---------------------------------

Three major projects in OOP: encapsulation, inheritance, polymorphism, v func How is it implemented, what is v table? What does the previous pure Storagexx multi-inheritance virtual function pointer look like in memory?

Familiar with all the const static situations, the const pointer and pointer to const and the difference between the two? It's not the same thing that static is put in different places.

Memory leaks are sure to be asked, rule of three is the foundation, and exception safe is difficult. The solution is very simple, in the industry smart pointer is over, not so many tricks, the industry basically do not see bare hands. Don't underestimate exception safe, it takes time to learn.

Then is the STL, most people who self-proclaimed to understand C + +, Basic will not understand how allocator is going on.

What the hell is RAII? At least I heard it.

OS operating system is still better looking. OS School out of the basic will be focused on two knowledge points, process management and file system; Process management heap non-infra development classes are important, and the infra class is important. Basically know what the process is, what the context switch is, what you do in the real world will trigger it and cost what. What are virtual mem and physical mem respectively?

Distributed

Back-end words, take a good look and rest. As well as the JS single page application principle (many applications need this principle to reduce latency), and how C + + is implemented, you need a bit of a basic understanding of node and Engin X.

Look at MVC.

Design Patterns

Understand the process, stack and heap, and give a simple program that you can draw out in memory for me from beginning to end.

Concurrent programming generally do not test, but also the need for practical experience to grow. Simple examples are best written out, race conditon some are very complex you can not see but simple to be able to speak clearly.

Understand how the CPU cache works, and why many data structures or algorithms are very slow. Locality, the principle of locality

If you understand concurrent well, that instructions pipeline if you can understand better.

Agile development You know it's true, code review, the test flow has a concept.

Template usually does not use too wild method, are very good. Metaprogramming how much to understand the benefits of where? This thing is very good, the United States on Mars that the car is almost metaprogramming.

Static linking, dynamic linking pros and cons.

How to avoid ring dependence.

Everything from compile to linking to the last stage.

Similarly, how to manage large C + + code, how to divide into modules, reasonable inheritance. The most important thing is how to divide the module to test.

Let you write the program in the field remember to add Const const, small program all inline, can wear ref do not copy. There must be a sentry at the beginning, that is #ifndef #define #endif

A shot is a namespace, telling someone you're working.

To see the Google C + + specification, C + + is a different code style can be written in a different language.

Can use STL absolutely do not write their own, tranform those to be used. I will write comparator, especially to Set/map.

Be sure to have the concept of a process, such as if there is only one machine, you have to make a in mem cache than the Redis block.

When it comes to smart pointer it's important to mention the idea of who owns the pointer.

Most people read only the first chapter, so the risk of doing the calculations with macros is likely to be tested, Scott Meyers effective C + + Chapter Ii.

Add:

C++11 do not need excessive care, first optimistic about inheritance, most of the industrial people themselves are still learning stage, and in addition to fancy new projects, mature projects generally will not follow the new.

But smart pointer must be optimistic, general C + + to make a point look of the company, the interior has its own C + + standard, very early in the 03 and 11 is basically the state, mainly smart pointer.

You can be natural, but generally not forced. Like metaprogramming, face your people in this respect may still stay in the theoretical level, too many things are privately play, a lot of things do not always meet in the work.

If there is time, Scott Meyers's four Effectvie is absolutely classic.

If you can get on YouTube, search Jon Kalb's exception safe on Cppcon and speak very well, cppcon best talk of the year.

The last mentality: the interviewer generally will not expect fresh students can answer all the questions, but will pour out to ask, so although few people can answer all come up, but can be a lot of candiates to get a very clear level, who strong who weak. Interview no hard bar, who do better, who will be able to stand out.

Also pay attention to open the topic, you can understand the non-classroom technical hobbies in school, understand the ability to communicate with people.

The strong left, the weak leave, not because it is fresh water or something, not to mention that we are fresh students.

Experienced has experienced face method, will tend to do in-depth to the field level to see if it and the group do things wedge together. Experienced seldom have a general recruit, are all in the group's own face.

Make sure you do it yourself, do it yourself, and never forget it, even if you forget a few key words, you can remember.

Finally, you must not forget the data structure and algorithm components.

--

C + + interview notes

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.