While interview questions mostly tend to focus on the intensity and frequency of problem solving skills, you need to first get your basics right.
Here are 10 Embedded C Interview Questions that you may be asked in your next interview.
1. What do you understand by the term stack overflow?
Stack overflow is defined as the condition which arises when a particular program seeks to access superfluous stack memory. In other words, it is when the program looks forward to crossing the limit of the stack boundary to eventually collapse or crash. 2. Why do you think stack overflow transpires in the first place?
There could be many potential reasons behind the occurrence of the stack overflow. For instance, redundant arguments and clumsy application of recursion could be the leading proponents. Apart from that, it may occur due to the construction of an outsize local array and the presence of nested function calls. 3. Can you highlight the differences between CISC and RISC?
There are many differences between the two. Reduced Instruction Set Computer, or RISC, does not consist of a memory unit unlike the CISC, or Complex Instruction Set Computer. Secondly, RISC is a relatively faster processor than CISC in terms of calculations. Also, RISC ensures a simple decoding of operations unlike a CISC processor. Lastly, RISC has a very low execution time compared to CISC. 4. What do you understand by a function pointer?
As the name suggests, it is a pointer that points to a function instead of a variable. And this is precisely where a function pointer stands apart from the class of other pointers. Technically speaking, a function pointer is one which stores the address of a particular function in order to be availed of by the concerned program through function invoking. 5. What do you understand by the term structure padding?
Padding is essentially the induction of redundant bytes into a particular structure. More specifically, it is the function of the compiler to embed some extra bytes between the units of either a structure or a union. This is known as the process of padding. Basically, structure padding is used for the purpose of data type orientation. Consequently, structure padding ends up augmenting the performance quotient of the processor.
You may also like:
6. Can you tell us something about the dangling pointers in embedded C?
Dangling pointers are clearly aberrations that arise due to the obliteration of a referencing object. It is known as dangling because the pointer is essentially pointing to a ghost memory, one that is not at its disposal. Consequently, it gives rise to what is known as the segmentation fault.
7. What is the function of the keyword const? Give an example.
So far as the keyword const is concerned, it is basically used to make a variable read-only type. For example: const int iData=0; During compilation, the keyword const chiefly acts as an indication to the compiler that the value of the declaring object is not subject to further alteration. So, it stands that the keyword is incapable of reassigning at runtime. 8. Why should we use the keyword const in the first place?
Indeed, const has many essential applications throughout the course of a program. For instance, it is of great use in a call by reference function argument. Secondly, const is particularly useful when you do not seek to change the value of an initialized variable. 9. What are the chief applications of static in embedded C?
Static is an important keyword in that it protects a variable from infringement by a separate translation unit. Also, it is useful in that it maintains the prior value of the declared variable between several function invocations. It is important to keep in mind that a static keyword initializes a variable only once. 10. What is the chief functionality of realloc ()?
As the titular indication suggests, it is chiefly used to resize the allocation of memory. Technically, it takes in two arguments. The first one is the pointer to the formerly allocated memory while the second one is the reference to the new size.
Looking for C Jobs in top cities? Click at the links below:
• C Jobs in Bengaluru• C Jobs in Chennai• C Jobs in Hyderabad• C Jobs in Mumbai• C Jobs in Pune