1. I would like to ask questions about windows and security. After logging on to Windows with an account, how is my personal information loaded into the process? What is the minimum unit for Windows resource allocation and execution? When is the folder permission determined? How does Windows implement this permission?
The first question is dumb. I only replied that the smallest unit of resource allocation is the process, and the smallest unit of execution is the thread. I don't know if it is right (about (1) the relationship between the system and the process, and (2) between the Process and the thread is like this: (1) is like (2; multiple processes can be executed simultaneously in a system. One process has n> = 1 thread .)
Here I naturally come to another question: What is process synchronization, what is thread synchronization, what is the difference between Process Synchronization and thread synchronization?
I do not know any other sub-problems in this question. Please kindly advise.
2. Have you heard of Kerberos? What is it? What is it?
I have never heard of it. After checking on the internet, I am not very familiar with what is used for encryption and symmetric encryption.
3. What is fiber?
Fiber means optical fiber (I am a physical engineer, and I guess the interviewer was already ft ).
Fiber is a fiber program. It is a UNIX concept. It is similar to a thread in windows. But to port code from UNIX to windows, convertthreadtofiber conversion is required (this is what I think in the book, I think it is strange, why not convertfibertothread? Because it is transplanted from UNIX to Windows !)
4. How to insert a node before the current pointer of a one-way linked list?
I am so strange. How can I insert a node in front of the current pointer in a one-way linked list? I read the data structure book and remember two pointers at the same time, one is currptr (the current pointer) and the other is prevptr, so this is easy to do. But what should I do if the interviewer asks for a single current pointer? It may be that I understood it wrong or what answer he asked. When I answered the question, I only talked about finding the current head one by one until I found the current head (in fact, this is also the case of prevptr)
5. When calling Windows API in user mode, it is transferred to the kernel layer. What changes have you made?
What changes? What is user mode and what is the kernel layer?
6. Do you know the nested use of try catch? What should I pay attention to when using it?
I don't know. Try catch is never used. It may be common to write small programs, and it is not needed, so it was loaded at that time, because the interviewer who does not know how to handle the error, the interviewer certainly shook his head. It is estimated that he is again ft.
7. How can I debug a compiled program at runtime?
After compilation, it is run out of the compiler. Can it be debugged? I got ft.
8. when debugging a loop, if you set a breakpoint, it will stop when you encounter this breakpoint every time you enter the loop. Of course, you can set monitoring variables in it, but the source code is modified in this way, is there any way?
I have never debugged this way. I directly set monitoring variables. Use assert ()?
9. there are two sets of Dynamic Distribution in C/C ++: (1) malloc () Free () (2) New Delete. Can I use it interactively? What should I pay attention, can you make some comments?
Ft. My principle is to use malloc to release it as soon as it is free, and delete as soon as it is used as new. Is there always nothing wrong with this? The only difference between the two is that when an abstract class is used, the former will not call constructor/destructor, while the latter will. What other comments can I make?
10. Can I translate linked list memory with free?
No, but I know that the answer is wrong. I also said that if it's just free (head), it's just to release the head node. The memory of all other nodes is still there, but they will never be retrieve due to the loss of header nodes. (Is this a kind of memory leakage ?)
If you really want to use free to release the linked list memory, you should release each node in the traverse table.
11. when defining a function:
Type F (Arglist ...)
{
/*
What will the compiler add here?
*/
Int A, B;/* the programmer defines the variables embodied in some functions */
Char X, Y;
....
Return;
/*
What will the compiler add here?
*/
}
I don't know what he wants to ask. I only know that when F () is executed from main (), the F parameter initialization (Copy copy) is required. When exiting, the built-in variables and copy Copy are revoked. What else does the compiler do?
12. How does the C/C ++ compiler handle non-initialized memory areas? What initialization work does it do? (In fact, Initialization is performed. Which of the following types are available)
I really don't know about this. I just mentioned it. I have seen a variable that has not been initialized for output debugging, and I will see 0 xcccccccccc. The interviewer said these are one of them. Is there anything else? I don't know.
13. When do global variables in multiple files define, allocate space, and initialize them?
I don't know how to answer this question. I only know that global variables and static variables are allocated in the same memory type area.
(I thought it was important for me to come back from the interview, but I couldn't find a very popular answer on the Internet. It took a lot of time. Please help me)
14. What is the difference between static in C and static in C ++?
15. What is the basic principle of vtable?
16. What are the differences between class and struct in C/C ++ and C?
17. There are a total of 91251 Chinese characters in the Guoan font. How does Unicode indicate these Chinese characters? Because two bytes (65536 combinations) are not enough? Linux with UTF-8 is certainly possible, Windows is how to achieve? I have never understood why Unicode is used to represent all the words in the world. How stupid designers should also know how to expand the font. Besides, Ms always uses Chinese characters, chinese people should always know that all Chinese characters cannot be expressed in Unicode in only two bytes.
18. During pointer operations, for example, a pointer is defined:
Type * P;
Then execute:
P ++;
This will move P to the sizeof (type) byte.
I was thinking, how does the system know how to move these bytes? The pointer type must be remembered in some places in the memory. Where can I remember it? Is there a table that remembers the attributes of each variable when the program starts running?
This is actually the same as defining a non-pointer variable:
Int X;
How does the system know that 4 bytes are required (32-bit server)
19. What is the relationship between the FAT32 (NTFs) of the disk partition and the 32-bit physical CPU and the 32-bit OS kernel?
20. Will Microsoft use UTF-8 in future operating systems? Based on compatibility and commercial market operations, isn't it possible?
21. Two types of struct:
Typedef struct _ S1
{
Int X;
Char y;
Char Z;
} S1;
Typedef struct _ s2
{
Char X;
Int y;
Char Z;
} S2;
Sizeof (S1) =?
Sizeof (S2) =?
Answer:
Sizeof (S1) = 8
Sizeof (S2) = 8
My question is how is alignment? What is the value of the Null Byte? Is there initialization?
Typedef struct _ Test
{
Char x1;
Short X2;
Float X3;
Char X4;
} Test;
What is sizeof (TEST? (Answer 12)
22. How is malloc () implemented? I have read the source code in vs6, which is too complicated to understand. Can you tell me your thoughts?
23. How to test a Coke machine (this is a problem during my phone interview )? What test cases are there?
24. How can I determine whether the PV operation is mutually exclusive or synchronous in the operating system? How can we determine the sequence of PV operations? How many semaphores should be set? How to Set it? Please answer in plain language. Here:
Http://www.ahtvu.ah.cn/jxc1/zhykch/5103/kc2.htm
It may have been quite clear, but I still don't understand it? I still haven't found any satisfactory explanation about the five philosophers dining, and there are many questions. Please help me.
Extended question: What is the difference between Process Synchronization and thread synchronization?
Q. I have a question about windows and security. After logging on to Windows with an account, how is my personal information loaded into the process? What is the minimum unit for Windows resource allocation and execution? When is the folder permission determined? How does Windows implement this permission?
A: The winlogon.exe process is responsible for loading user information. The minimum unit for Windows resource allocation and execution is page. The folder permission is linked by the system handle. For details, see native API-ntqueryinforamtionfile.
Q. Have you heard of Kerberos? What is it? What is it?
A. Security Certificate encryption verification. See <Windows 2000 Distributed Management>
Q. What is fiber?
A. Optical Fiber. See <windows core programming>
Q. When I call Windows API in user mode, I transfer it to the kernel layer. What are the changes?
A. The main change is that the access to memory in the user mode is OS-protected 32/64-bit virtual address, while the access to memory in the kernel layer is unprotected.
Q. Do you know the nested use of try catch? What should I pay attention to when using it?
A. During exception capture, you need to be aware of the structure exception (for example, zero Division) or Win32 exception. Pay special attention to stack processing. For details, see <C ++ primer>
Q. How can I debug a compiled program at runtime?
A. windbg.exe, SoftICE, etc.
Q. when debugging a loop, if you set a breakpoint, it will stop when you encounter this breakpoint every time you enter the loop. Of course, you can set monitoring variables in it, but the source code is modified in this way, is there any way?
A. Visual C ++ ide provides conditional breakpoint settings.
Q. there are two sets of Dynamic Distribution in C/C ++: (1) malloc () Free () (2) New Delete. Can I use it interactively? What should I pay attention, can you make some comments?
A. refer to msdn: the new operator is used to allocate objects and arrays of objects. the new operator allocates from a program memory area called the "free store. "in C, the free store is often referred to as the" heap."