Interview Questions for typical LINUX programmers

Source: Internet
Author: User
Interview Questions are a set of PEN questions, which are more classic (closed exam, 100 minutes to finish the exam, it is best to write the steps to solve the problem). If you can correct 7%, it means that you step into the door of linux programming, if you are able to answer more than 90% correctly, you accept me as a disciple (poor pity for me). If you fail, it will be the same as me: cainiao!

I. basic questions:
1. List the LINUX distributions you have used and the GCC and GLIB versions you have used.
2. What layer is the PPP protocol and HTTP protocol in the ISO seven-layer reference model?
3. Tell the similarities and differences between TCP and UDP
4. How long is the IP packet header? What type of IP Address does 146.0.0.0 belong?
5. Write down the development process of the linux embedded system.
6. In the GCC parameters listed below, please write the meaning one by one:
-C
-O
-Share
-Static
7. Write the meanings of the following parameters:
_ Attribute _ (packet)
Volatile

# Define ANYONE (DIR) < (FILE) <
2. Program reading questions (output program results ):
1. Pass by value and by address (This question is too simple, omitted)
2. pointer operation (relatively simple, omitted)
3. char * p;
P = malloc (20 );
Char q *;
Q = strcpy (p, "Please answer the question carefully ");
Q + = 7;
Printf ("% s", q );
Printf ("% s", p );
4. # define X 1
# Define y x + 1
Int p;
P = x + y/2;
Printf ("% d", p );
5. struct n {
Int p;
Char name;
};
Void structp (struct n B)
{
B. p = 10;
B. name = 'X ';
}
Int main ()
{
Int x = 5;
Char name = 'y ';
A. p = x;
A. name = name;
Structp ();
Printf ("% d", a. p );
Printf ("% c", a. name );
}
6. omitted (I cannot remember clearly, as if it was a string operation question)
7. omitted (structure and double-stranded table, this question is more difficult and takes more time)
8. Analyze the following programs and write the results
Void GetMemory2 (char ** p, int num)
{
* P = (char *) malloc (num );
}
Void test (void)
{
Char * STR = NULL;
Getmemory (& STR, 100 );
Strcpy (STR, "hello ");
Printf (STR );
}
9. Analyze the following programs and write the results
Char * getmemory (void)
{
Char P [] = "Hello World ";
Return P;
}
Void test (void)
{
Char * STR = NULL;
STR = getmemory ();
Printf (STR );
}

Iii. Program writing questions:
1. Use C language to implement the current function (library functions cannot be called)
Char * strcpy (char * DEST, const char * SRC)
Why does the string copy function return a character pointer?
2. There are two integer variables X. How does y exchange two values without any intermediate variables?
3. Write a comparison between the bool flag and the zero value, and compare the pointer with the zero value.
4. Basic English questions (I am not good at English, so I can't remember it. This question has two parts: the first part is the declaration variable, and the second part is the final filling)
5. multiple-choice questions (I can't remember the specific alternative answers to this question, but if you have mastered this knowledge, you don't need alternative answers. If you don't know it, you just want to guess the question)
1. Which of the following methods has the largest data latency during network data transmission? Which of the following methods should be used for transmission to minimize the error code? Which of the following improvements can be made for packet transmission? What is the direct result of improvement? In order to minimize the data error rate, which method (or combination) should be used for transmission? (Tip: alternative answers include line switching, group switching, and virtual circuits)
2. there is a binary search tree. The physical storage occupies three storage units by one node. For example, if there is a node P, P information is stored in memory 1001, 1002 store the left link pointer of P, 1003 store the right link pointer of P, the following is a node table to be stored:
P: P (node information), L1 (left link node pointer of P), R1 (right link node pointer of P), and so on)
W: W, L2, R2
E: E, L3, R3
R: R, L4, R4
C: C, L5, R5
Generate a binary search tree from the above nodes in alphabetical order and store it in continuous units after the memory reaches 1001 (storage nodes are stored in the primary order, for example, C is stored in 1003, E should be stored in 1006 ).
What memory units will L2, R3, and L5 be stored in?
For this binary search tree, write the traversal order respectively.

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.