EFS Tutorial Interview Questions
Introduction
Some of the questions in this document are evolutions of questions asked in A ‘C’ Test: The 0x10 Best Questions for Would-be Embedded Programmers. The questions here were conceived by @Christopher Chung for an EFS tutorial session. The questions here breakdown some of the underlying concepts and also query more fundamentals then are given in the original source which assumes you already understand them. Note this source also provides solutions to the questions it asks which may be useful for learning purposes. Additionally other relevant information can be found in other portions of this EFS knowledge base confluence (i.e. C Keywords & Preprocessor Definitons).
Questions
What is an interrupt?
What is an ISR?
What is wrong with this ISR?
double calculate_area(double radius) {
double area = radius * radius * 3.14;
printf("Area: %d", area);
return area;
}
Implement a circular buffer
Implement a Stack
Implement a queue
Implement a linked list (and manipulation)
How do you determine if a number is odd
How do you determine if the n’th bit is 1
Within a structure, how large is a struct with one 8 bit integer and one 16 bit integer on a 32 bit processor
What is the volatile keyword
What is the static keyword
What is a const
Can a variable be both const and volatile
What is a union
What is a void pointer
If you want to pass a large struct into a function, should you pass by reference or pointer
Define the following
(a) An integer
(b) A pointer to an integer
(c) A pointer to a pointer to an integer
(d) An array of ten integers
(e) An array of ten pointers to integers
(f) A pointer to an array of ten integers
(g) A pointer to a function that takes an integer as an argument and returns an integer
(h) An array of ten pointers to functions that take an integer argument and return an integer.
Difference between spi and i2c
What is UART?
What are the difference parts of memory
Where does each variable in the code snippet go?
#define A 5
int B = 0;
static int C = 0;
void myFunc(int D, int E)
{
static int F = 0;
int G;
for (G = 0; G < 10; G++)
{
F++;
}
int* H = (int*)malloc(sizeof(int));
}
What is the difference between & and &&
What is endianess?
Difference between float and double?
What is the preprocessor?