A company's CC ++ programmer interview problem

xiaoxiao2021-03-06  20

From vchelp

A person who is primarily aimed at the students who graduated from the boundary;

I hope everyone has to help;

algorithm:

1. What is NPC, NP-HARD?

2. What is the time complexity of bubble sorting?

Speaking at least one algorithm than it;

What is the limit time complexity of sorting?

3. There is a linked list, how to determine it is a loop list?

If the list is one-way?

What can the point in the loop may be anywhere?

If the cache space is limited, what is a constant?

Can I only use 2 caches?

4. There is a file, saved several integers, how to get one of the integers with average probability?

If the number of integers is unknown?

If an integer is stored in a string, such as: (that is, how to get a random string)

123

-456

...

If you only allow files to be changed once?

5. With two groups of data, in memory, you need 1 and 2 minutes for them; then use two threads to be sorted together, how much time?

C / C :

1. Similarities and aspects of C and C ;

2. Differences between C, C , VC, BC, TC;

3. Try ... Catch keywords in C ;

4. The usage of enumeration, and the difference between it and the macro;

5. Const's usage, as well as declaring constant variables and macros;

6. The difference between reference and pointer in C ;

7. What is the meaning of Virtual and inline in C ?

The characteristics of virtual functions;

The characteristics of the inline function;

Whether a function is the virtual function is the inline function?

8. The following keywords' meaning and usage:

Extern, extern "c", static, explicit, register, # undef, # impNDEF

9. What is the function overload and coverage?

Why does C does not support function overload?

Why can C support function overload?

10. In the VC, what is the meaning of Debug and Release option within the compilation toolbar?

11. Write the MY_MEMCPY function to implement a function similar to the library function Memcpy, and cannot use any library functions;

12. Write the My_STRCPY function, implement similar functions similar to the library function strcpy, and cannot use any library functions;

13. Write the GBK_STRLEN function, calculate the length of the string containing Chinese characters, and the Chinese characters are treated as a character;

It is known: Chinese character encoding is double byte, where the first one is <0, the tail byte is outside of 0 ~ 63; (if one byte is -128 ~ 127)

14. Function assert usage;

15. Why do you see this code in front of the header file:

#ifndef _STDIO_H_

#define _STDIO_H_

16. Why is the array name as a parameter, change the contents of the array, and other types of intravenys do not change the value of the variables? -------------------------------------------------- ----------------------------

:( I've looked at it, many are all known to solve it, the dish is a word! C is the foundation, it seems to be calm and see ~~

转载请注明原文地址:https://www.9cbs.com/read-41140.html

New Post(0)