A company's C/C ++ programmer interview questions

Source: Internet
Author: User
A company's C/C ++ programmer interview questions
Favorite from http://blog.csdn.net/w3nsir
From vchelp
It is mainly for students who graduated from the field and those who have less than one year of work experience;
Hope to help everyone;

Algorithm:
1. What is NPC, NP-hard?
2. What is the time complexity of Bubble sorting?
Speak out at least one Faster Algorithm than it;
What is the maximum time complexity of sorting?
3. How can I determine a linked list as a circular linked list?
What if the linked list is unidirectional?
What if the point of the loop may be in any position?
What if the cache space is limited, for example, a constant?
What if I can only use two caches?
4. There is a file that stores several integers. How can we obtain an integer at random with an average probability?
What if the number of integers is unknown?
If integers are stored as strings, for example: (how to obtain a random string)
123
-456
...
What if only one file is allowed?
5. It takes one or two minutes to sort two groups of data in the memory. How long does it take to sort them together using two threads?

C/C ++:
1. Similarities and Differences between C and C ++;
2. Differences between C, C ++, Vc, BC, and TC;
3. Try in C ++... Usage and advantages of catch keywords;
4. Usage of enumeration and its difference from macros;
5. Usage of const and the difference between declaring const variables and macros;
6. Differences between references and pointers in C ++;
7. What are the meanings of virtual and inline in C ++?
Features of virtual functions;
Features of inline functions;
Can a function be a virtual function or an inline function?
8. Meanings and usage of the following keywords:
Extern, extern "C", static, explicit, register, # UNDEF, # ifndef
9. What is function overload and overwrite?
Why does C not support function overloading?
Why does C ++ support function overloading?
10. In VC, what is the meaning of the debug and release options in the compilation toolbar?
11. Compile the my_memcpy function to implement functions similar to the database function memcpy. You cannot use any database functions;
12. Compile the my_strcpy function to implement functions similar to the strcpy function of the library. No library function can be used;
13. Compile the gbk_strlen function to calculate the length of a string containing Chinese characters. Chinese characters are processed as one character;
Known: Chinese characters are encoded in double bytes, with the first byte <0, and the last byte between 0 and ~ Other than 63; (if a byte is-128 ~ 127)
14. usage of the function assert;
15. Why do I see this code at the beginning of the header file:
# Ifndef _ stdio_h _
# DEFINE _ stdio_h _
16. Why does the array name change the content of the array as a parameter, while other types such as int do not change the value of the variable?

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.