Common interview questions for embedded software developer

Let’s see some of the common interview questions asked during an embedded C developer interview.

EMBEDDED SYSTEM

1. What changes are to be done on software if the embedded software is ported from a 32 bit architecture to a 64 bit architecture.

2. Can you call a static function which belongs to a different file, if possible How?

3. Volatile qualifier and its use in embedded software.

4. How interrupts are working in embedded software.

5. Explain how you will implement an Ethernet receiver driver using interrupt.

6. Explain about ADCs

7. Explain interrupt latency.

8. Difference between ARM and PowerPC architecture.

9. Explain how stack is working.

10. Memory layout of an executable.

11. Explain the protocols I2C, SPI and CAN.

12. What is the mechanism which determines the baud rate of a CAN network.

RTOS

1. Priority inversion, priority inheritance, priority ceiling.

2. What is deadlock and livelock.

3. Difference between Semaphore and Mutex.

4. Explain a situation where you have used Semaphore and Mutex in you past projects.

5. Process synchronization methods in RTOS.

GENERAL

1. Why are you looking for a change?

2. What is your expectation from the new job, if offered?

PROJECT

1. Explain your recent project.

2. Draw the software architecture of your recent project.

3. Challenges you faced during your project.

C CODING

1. How to find the Nth node from the end in a singly linked list.

2. Code to modify the even indexed members in an array.

3. Implement XOR without using the operator.

4. Reverse a string.

5. Convert little endian to big endian.

6. Write a C code to print a string without using a semicolon in the program.

7. Write a program to find a merge in a singly linked list.

Some of the interesting features of the C Language

Some of the interesting features of the C Language

Here in this article we are listing out few of the interesting features with the C language. Some of the points listed out here are not used normally during the implementation of a production code. But these tips are worthy of noting down. The more we understand the C language the more confident we would become in coding with this magnificent language.

The features listed out below will be updated and added with more information and points going forward. Also feel free to post your views as comments to this article..

So let’s start with….  🙂

 

1. Function called with multiple arguments

In C if a function definition does not specify any parameters, then this function can be called with any number of arguments or without any. For example, see the below sample code:

2. The terms “parameters” and “arguments”

The term ‘parameter’ refers to any declaration within the parentheses following a function name in a function declaration or definition; the term ‘arguments’ refers to any expression within the parentheses of a function call.

3. Order of evaluation of function parameters

There is no guarantee about the evaluation of the order of the function parameters in C. The order of evaluation is purely implementation dependent, so while writing programs we should not use expressions which can cause side-effects. This would be better explained with the below example:

In the above example, the result values of x and y will be implementation dependent.

4. Multiple declaration of global variable

C allows a global variable to be declared multiple times; having said so, there should only be one definition for the variable. See the below example:

Here in the above example you will be getting the answer as 10.
But if you try to re-declare a local variable, then you would be getting the redeclaration of ‘x’ with no linkage error during compilation.

Bitwise operators in C: 2 Simple Programs to start with

Bitwise operators in C: 2 Simple Programs to start with

Bitwise operators in C can be very handy in writing simple and efficient codes to solve many logical requirements.
Just to get an overview of how the bitwise operators in C can solve logical problems easily, here we are giving two examples which are tested in Linux environment.

1. Find whether the given input number in even or odd.
2. Find the missing number from the series of natural numbers starting from 1.

Note: To make the code easily understandable, some of the common defensive programming techniques are omitted.
So let’s start with the coding,
.
.
1. Find whether the given input number is even or odd.

Here in this simple program, the input is read from the ‘stdin’ and read into the variable ‘input’. If the entered value is zero, we are jumping to ‘end’ and exits the program.

The code, res = !(input & 1); is computing whether the given number is even or odd. Here the variable ‘res’ will be set to ‘TRUE’ if the variable ‘input’ is containing an even number. Since the last bit of even number will be zero, the ANDing of ‘input’ with 1 will result in zero ((input & 1)), thereby making the entire right hand side operation to ‘TRUE’ (!(input & 1))

2. Find the missing number from the series of natural numbers starting from 1.

In this program we can find the missing number from the given list of natural numbers starting from 1. The input list of numbers is stored in the array variable ‘real_input’. The function ‘GetTheOneMissingNumber()’ will find out the missing number from the given list.

In this program we are performing XOR between all the real numbers starting from 1 to ‘count+1’ and saving it to the local variable ‘xor_res2’. Similarly all the elements in the given list ‘input_list’ are also XOR’ed and saved into the local variable ‘xor_res1’. A final XOR between the values of ‘xor_res2’ and ‘xor_res1’ will give the missing number.

Computation explained,
xor_res1 = X1 ^ X2 ^ X3 ^ X5 ^ X6 ^ X7 ^ X8 ^ X9 ^ X10
xor_res2 = X1 ^ X2 ^ X3 ^ X4 ^ X5 ^ X6 ^ X7 ^ X8 ^ X9 ^ X10
xor_res1 ^ xor_res2 = (X1 ^ X1) ^ (X2 ^ X2) ^ (X3 ^ X3) ^ (X4) ^ (X5 ^ X5) ^… (X10 ^ X10) = X4