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?