Interviewing C + + programmers, what kind of question is a good question?

Source: Internet
Author: User

Original link:

"Chen's huge god in the answer of knowing"


For fresh students:

    • The complexity of the basic operations of each container in the standard library. The complexity of the standard library algorithm, such as the average complexity of std::sort (), the worst-case complexity (Answer O (n^2) and O (n log n) are all pairs), and when the worst happens.
    • The data structure of each container (except deque) of the standard library (the standard party does not spray, the mainstream STL realizes the data structure is similar), as well as the vector capacity growth mode. If the answer is particularly good, you can also ask why vector: the complexity of the:p ush_back () is the apportionment of O (1), as a bonus point.
    • A simple algorithm problem that can be easily solved with lower_bound/upper_bound, either implement Set_intersection () or set_union () or merge (), or implement word count to count the occurrences of each word (most More than more than 10 lines of code), and if there is time, the output is sorted by the number of occurrences.
for social Recruitment, supplementary questions:
    • The iterator fails. (It is not required to remember all the scenes, but to have this concept, actually know the data structure of the words are not difficult to reason.) )
    • Thread safety for standard libraries.
    • Automation object lifetime Management, smart pointers, circular references, weak_ptr.
    • The list's insert ()/erase () is faster than the vector. (This is not so simple.) )

Note: The above content is self-aware, more information please check the discussion.

Interviewing C + + programmers, what kind of question is a good question?

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.