Current location - Education and Training Encyclopedia - Education and training - Wireless Network Optimization Engineer (Changsha Yaxun Network Technology Co., Ltd.)
Wireless Network Optimization Engineer (Changsha Yaxun Network Technology Co., Ltd.)
First of all, what is your major? It is best to do wireless network optimization in communication and computer, so that you will have some basic knowledge of network.

Secondly, this major requires you to have a certain understanding of wireless mobile networks, such as basic network structure, basic theory and basic concepts. But you don't have to be proficient, because you have to study again when you enter the industry, depending on the direction you are doing, such as 2g or 3g.

Thirdly, you should have a basic understanding of computers, preferably notebooks, which are standard for network optimization. Being able to use excel will be very important in network optimization, database and other middle and high periods. It would be better if you can simply program later, which is the requirement of the master.

Finally, you should be able to bear hardships, travel for a long time and adapt to harsh conditions.

In addition, if you can ask such a question, go to the professional forum to see what everyone has said. Mscbsc and c 1 14 are recommended.

Software engineers write test questions.

# Define seconds/year (60 * 60 * 24 * 365)UL

I want to see some things here:

1).# Define the basic knowledge of grammar (such as not ending with a semicolon, using parentheses, etc. )

2) Knowing that the preprocessor will calculate the value of the constant expression for you, write directly how you calculate the number of seconds in a year, instead of calculating the actual value, which is clearer and more cost-free.

3). Realize that this expression will overflow an integer of 16-bit machine-so use the long integer symbol L to tell the compiler that this constant is a long integer.

4) If you use UL (unsigned long integer) in the expression, then you have a good starting point. Remember, the first impression is very important.

2. Write a "standard" macro MIN which inputs two parameters and returns the smaller one.

# define MIN(A, b) ((a) <; = (B) (A) : (B))

The purpose of this test is to achieve the following objectives:

1). Identify the basic knowledge of #define application in macro. This is very important because macros are the only way to generate embedded code conveniently before inline operators become part of the standard C language. For embedded systems, in order to achieve the required performance, embedded code is usually necessary.

2). Knowledge of three conditional operators. This operator exists in C language because it enables the compiler to generate more optimized code than if-then-else. It is important to understand this usage.

3). Know how to carefully enclose parameters in parentheses in macros.

4). I also use this question to discuss the side effects of macros, such as: What will happen if you write the following code?

least = MIN(*p++,b);

3. What is the purpose of preprocessor identification #error?

If you don't know the answer, please refer to 1. This question is very useful for distinguishing normal buddies from nerds. Only a nerd would read the appendix of a C language textbook to find such a thing.

The answer to the question. Of course, if you are not looking for a nerd, then the candidate had better hope that he doesn't know the answer.

Infinite loop (infinite loop)

4. Infinite loop is often used in embedded systems. How to write infinite loop in C language?

There are several solutions to this problem. My first choice is:

while( 1) { }

Some programmers prefer the following scheme:

for(; ; ) { }

This realization makes me embarrassed, because this grammar does not accurately express what is happening. If a candidate takes this as a plan, I will take this as an opportunity to explore what they do.

Basic principles. If their basic answer is: "I was taught to do this, but I never thought about why." This will leave a bad impression on me.

The third option is to use goto.

Cycle:

...

Go to loop;

If the candidate gives the above scheme, it means that he is either an assembly language programmer (which may be a good thing) or a BASIC/FORTRAN programmer who wants to enter a new field.

Data declaration (data declaration)

5. Use the variable A to give the following definition.

A) integers.

B) a pointer to an integer.

C) pointer to pointer, pointer to integer (pointer to integer)

D) 10 array of integers.

E) An array with 10 pointers, with the pointers pointing to an integer (10 pointers pointing to an array of integers).

F) Pointer to 10 integer array.

G) Pointer to a function with integer parameters and returning an integer (pointer to a function with an integer as an independent variable and returning an integer).

H) An array with 10 pointers to a function that takes an integer parameter and returns an integer (an array of ten pointers points to a function that takes an integer parameter and returns an integer).

The answer is:

a)int a; //Integer

b)int * a; //Pointer to an integer

c)int * * a; //Pointer to integer pointer

d)int a[ 10]; // 10 array of integers

e)int * a[ 10]; //An array of 10 pointers to integers.

f)int(* a)[ 10]; //Pointer to 10 integer array

g)int(* a)(int); //Pointer to function A that takes integer parameters and returns an integer.

h)int(* a[ 10])(int); // 10 array of pointers to functions that take integer parameters and return integers.

It is often claimed that there are several questions here that can only be answered by turning over books. I agree with this statement. When I wrote this article, I did refer to the book to make sure the grammar was correct.

But during the interview, I expected to be asked this question (or something like that). Because during the interview, I definitely know the answer to this question. If the candidate doesn't know

Answer all of them (or at least most of them), then this interview will be unprepared. If the interviewer didn't prepare for this interview, then why can he prepare?

static

6. What is the function of the keyword static?

Few people can answer this simple question completely. In C language, the keyword static has three obvious functions:

1). In the function body, the variable declared as static keeps its value unchanged during calling the function.

2). Inside the module (but outside the function), variables declared as static can be accessed by functions used in the module, but not by other functions outside the module. It is a local global variable.

3). In a module, a function declared as static can only be called by other functions in the module. In other words, this function is limited to the local scope of the module that declares it.

Most candidates can answer the first part correctly, some can answer the second part correctly, and few people can understand the third part. This is a serious shortcoming of a candidate, because he obviously doesn't understand the benefits and importance of localizing data and code range.

constant

7. What does the keyword const mean?

As soon as I heard the interviewee say "const means constant", I knew I was dealing with a layman. Last year, Dan Saks completely summarized all the usages of const in his article, so every ESP reader should be very familiar with what const can and cannot do. If you have never read the article, say const means "read only". Although this answer is not a complete answer, I accept it as the correct answer. If you want to know more detailed answers, please read Sachs' article carefully. If the examinee can answer this question correctly, I will ask him an extra question: What do these statements mean?

const int a;

int const a;

const int * a;

int * const a;

int const * a const

The first two have the same function, and a is a constant integer. The third meaning is that a is a pointer to a constant integer (that is, the integer cannot be modified, but the pointer can). The fourth meaning A is a const pointer, which points to an integer (that is, the integer pointed by the pointer can be modified, but the pointer cannot be modified). The last one indicates that A is a const pointer and points to a constant integer (that is, the integer pointed by the pointer cannot be modified, and neither can the pointer). If the candidate can answer these questions correctly, then he left a good impression on me. By the way, you may ask, even if you don't use the keyword const, it's easy to write a program with the right function, so why do I value the keyword const so much? I also have the following reasons:

1). The function of the keyword const is to convey very useful information to people who read your code. In fact, declaring a parameter as a constant is to tell the user the application purpose of this parameter. If you spend a lot of time cleaning up the rubbish left by others, you will soon learn to appreciate the extra information. (Of course, programmers who know how to use const rarely leave the garbage to others to clean up. )

2) By giving the optimizer some additional information, using the keyword const can generate more compact code.

3). Reasonable use of the keyword const can make the compiler naturally protect those parameters that don't want to be changed and prevent them from being unintentionally modified by the code. In short, this can reduce the occurrence of bugs.

unstable

8. What is the meaning of the keyword volatile and give three different examples.

A variable defined as volatile means that the variable may be changed accidentally, so the compiler will not adopt the value of the variable. To be precise, the optimizer must carefully re-read the value of this variable every time it is used, instead of using the backup stored in the register. Here are some examples of variable variables:

1). Hardware registers (such as status registers) of parallel devices.

2) Non-automatic variables to be accessed in the interrupt service subroutine.

3). Variables shared by multiple tasks in multithreaded applications.

People who can't answer this question won't be hired. I think this is the most basic problem to distinguish C programmers from embedded system programmers. Embedded system programmers often have to deal with hardware, interrupts, RTOS, etc., all of which need variable variables. Failure to understand changeable content will bring disaster.

Assuming that the interviewee answers this question correctly (well, I doubt it will), I will dig deeper to see if this person really understands the full importance of volatile.

1). Can the parameter be a constant or a variable? Explain why.

2). Can the pointer be changeable? Explain why.

3). What's wrong with the following functions:

int square(volatile int *ptr)

{

return * ptr * * ptr

}

Here are the answers:

1). Yes. Read-only status registers are an example. It is changeable because it may be changed unexpectedly. It is a constant because programs should not try to modify it.

2). Yes. Although this is not very common. An example is when a service subroutine fixes a pointer to a buffer.

3). There is a prank in this code. The purpose of this code is to return the square of the value pointed by the pointer *ptr, but since *ptr points to a variable parameter, the compiler will generate code similar to the following:

int square(volatile int *ptr)

{

int a,b;

a = * ptr

b = * ptr

Return a * b;;

}

Since the value of *ptr may change unexpectedly, A and B may be different. Therefore, this code may not return the square value you expect! The correct code is as follows:

Long square (variable int *ptr)

{

int a;

a = * ptr

Return to a * a

}

bit manipulation

9. Embedded systems always require users to perform bit operations on variables or registers. Given an integer variable A, write two pieces of code, the first one sets bit 3 of A, and the second one clears bit 3 of A. In the above two operations, other bits are kept unchanged.

There are three basic reactions to this problem.

1). I don't know how to start. Quilt hasn't done any embedded system work.

2). Use bit fields. Bit fields is something thrown into the dead corner of C language, which ensures that your code is not portable between different compilers, but also ensures that your code cannot be reused. Recently, I saw that Infineon wrote a driver for its complex communication chip, which used bit fields, which was completely useless to me, because my compiler realized bit fields in other ways. Morally speaking: Never let a non-embedded guy stick to the edge of actual hardware.

3). Use # definition and bit mask to operate. This is a highly portable method and should be used. The best solution is as follows:

# define bit 3(0x 1 & lt; & lt3)

Static int a;;

void set_bit3(void)

{

a | = BIT3

}

void clear_bit3(void)

{

a & amp= ~ BIT3

}

Some people like to define a mask and some explanatory constants to set and clear values, which is acceptable. I want to see a few points: explain constants, | = and&; = ~ operation.

Access a fixed memory location.

10. Embedded systems usually require programmers to access specific memory locations. In a project, you need to set the value of an integer variable with an absolute address of 0x67a9 to 0xaa66. This compiler is a pure ANSI compiler. Write code to accomplish this task.

This question tests whether you know that it is legal to convert an integer into a pointer in order to access an absolute address. The way to achieve this problem varies according to personal style. Typical similar code is as follows:

int * ptr

ptr =(int *)0x67a 9;

* ptr = 0x aa 55;

A more subtle method is:

*(int * const)(0x67a 9)= 0x aa 55;

Even if your taste is closer to the second option, I suggest you use the first option in the interview.

Interrupt (interrupt)

1 1. interrupt is an important part of embedded system, which leads many compiler developers to provide an extension-let standard C support interrupts. The representative fact is that a new keyword __interrupt has been generated. The following code uses the __interrupt keyword to define an interrupt service subroutine (ISR). Please comment on this code.

_ _ interrupt double compute_area (double radius)

{

Double area = PI * radius * radius;

printf(" Area = %f ",Area);

Return area;

}

There are so many errors in this function that people don't know where to start:

1).ISR cannot return a value. If you don't understand this, then you won't be hired.

2).ISR cannot pass parameters. If you don't see this, your chances of being hired are the same as the first one.

3). In many processors/compilers, floating points are usually non-reentrant. Some processors/compilers need to stack additional registers, and some processors/compilers just don't allow floating-point operations in ISR. In addition, ISR should be short and efficient, and it is unwise to do floating-point operations in ISR.

4). Consistent with the third point, printf () often has reentry and performance problems. If you lose the third and fourth points, I won't be too hard for you. Needless to say, if you can do the last two points, your employment prospects will be brighter and brighter.

Code example

12. What is the following code output and why?

Void foo (empty)

{

Unsigned int a = 6;;

int b =-20;

(a+b & gt; 6) Put option (">6"): puts ("<; = 6");

}

This question tests whether you know the principle of automatic integer conversion in C language, and I find that some developers know little about these things. Anyway, the answer to this unsigned integer problem is that the output is ">: 6". The reason is that when there are signed and unsigned types in the expression, all operands are automatically converted to unsigned types. Therefore, -20 becomes a big positive integer, so the result calculated by this expression is greater than 6. This is very important for embedded systems that often use unsigned data types. If you answer this question wrong, you may not get the job.

13. Evaluate the following code snippet:

Unsigned int zero = 0;;

Unsigned integer compzero = 0xFFFF

The zero complement of /* 1 */

For the processor whose int type is not 16 bits, the above code is incorrect. It should be written like this:

Unsigned integer compzero = ~ 0;

This question can really reveal whether candidates understand the importance of processor word length. In my experience, a good embedded programmer understands the details and limitations of hardware very accurately, but PC programs often regard hardware as an unavoidable annoyance.

At this stage, the candidate is either completely depressed or confident and determined to win. If it is obvious that the candidate is not very good, then the test is over here. But if it is obvious that the candidates are doing well, then I will throw out the following supplementary questions, which is more difficult. I think only excellent candidates can do well. By asking these questions, I hope to see more answers than answers. Anyway, think of it as entertainment ...

Dynamic memory allocation (dynamic memory allocation)

14. Although it is not as common as non-embedded computers, embedded systems still have the process of dynamically allocating memory from the heap. So what problems may exist in dynamic memory allocation in embedded systems?

Here, I expect candidates to mention memory fragmentation, fragmentation collection, the holding time of variables and so on. This topic is widely discussed in ESP magazines (mainly P.J. Plauger, whose explanation far exceeds anything I can mention here), so look back at these magazines! After asking the examinee to input a false sense of security, I took out such a small program: What is the output of the following code fragment and why?

char * ptr

if((ptr =(char *)malloc(0))= = NULL)

Puts ("get a null pointer");

other

Puts ("get a valid pointer");

This is an interesting question. I didn't think about this problem until one of my colleagues inadvertently passed the value of 0 to the function malloc and got a legal pointer. This is the code above, and the output of this code is "got a valid pointer". I use this to discuss such a problem and see if the interviewee thinks that the routine of the library is right. It is important to get the right answer, but the method of solving the problem and the basic principles of your decision are more important.

Typedef

15.Typedef is often used in C language to declare synonyms of existing data types. You can also do something similar with the preprocessor. For example, consider the following example:

# Define dPS structure *

Typedef structure s * tPS

The intention of the above two cases is to define dPS and tPS as pointers to structure S. Which method is better? (If any) Why?

This is a very delicate question, and anyone who answers this question correctly (for good reason) should be congratulated. The answer is: typedef is better. Consider the following example:

dPS p 1,p2;

tPS p3、P4;

The first extension is

Structure s * p 1, p2;

The above code defines p 1 as a pointer to the structure and defines p2 as the actual structure, which may not be what you want. The second example correctly defines two pointers p3 and p4.

16.c agrees with some shocking structures. Is the following structure legal? If so, what does it do?

int a = 5,b = 7,c;

c = a+++b;

This question will be the happy ending of this exam. Believe it or not, the above example is completely grammatical. The question is how does the compiler handle it? Low-level compilers will actually argue about this issue. According to the principle of maximum processing, compilers should be able to handle all legal usages as much as possible. Therefore, the above code is treated as:

c = a+++b;

So this code is followed by a = 6, b = 7 and c = 12+02.