Embedded C


Interview Questions on Embedded C

1. what are the conditions of ptr and *ptr after evaluation of *ptr++
2. Write an alogrithm to solve eight queens problem in a chess board
3. How do you execute multiplication and division by a number which is a power of 2 with less complexity
4. What is a reentrant function and what is its significance
5. What is the concept of structure padding and give an example
6. Write a subroutine for finding if a linked list is circular list or not
7. Write a subroutine to find the contents of bits 14:7 of a 32 bit variable without changing the contents of other bits
8. How do you find whether a processor is big endian or little endian. Also what does little endian and big endian represent
9. What happens when a variable is defined as volatile. what are the scenarios where we need to use volatile.
10. Can a constant variable be volatile. Give an example
11. What is the anamoly with a static variable. what happens if this variable is defined outside all functions. Give a method to access this variable in another file
12. Write a subroutine for finding the first bit set in an integer
13. What is a void pointer and NULL pointer.
14. What is a dangling pointer
15. What is dynamic memory allocation and static memory allocation. what is the need to dynamically allocating memory. How do you allocate
16. When an arithmetic expression contains two operators of same priority, how is the decision to execute taken.
17. Why are preprocessor directives used. give an example with using arguments. Also an example to use multi line definitions.
18. What is teh difference between structure and a union. when is a union used
19. What is a super loop and what is the need for this
20. Write functions for setting, toggling, getting and resetting a bit of a character
21. Write an algorithm to implement a Watchdog timer
22. What is a structure with bit fields and what is the advantage of using this
23. Whhat is meant by interrupt latency and how can it be reduced
24. What is meant by context switching. What are various paramters stored while context saving
25. what type of functions can be used in a ISR
26. what are pros and cons of macro and inline functions
27. Which parameters decide the size of data type for a processor
28. What happens if any registers are not free and we declare a variable as register class
29. Write prototype for a function pointer and array of function pointers
30. Dynamically allocated memory is allocated from which section of memory?
31. Write a code to stop including a file more than once even if we add the file
32. Give an example where if a macro definition is not included in brackets, it leads to an issue
33. what is the difference between if(i ==0 ) and if(0 == 1). which notation is preferred and why
34. write a program to swap a and b using +, - operators
35. write a program to swap a and b using ^ operator
36. write a code to swap the two nibbles in a byte
37. How to multiply a number by 7 in the fastest way
38. How to sum the digits of a numer in a single statement
39. How can you add two numbers without using + operator
40. sizeof() is an operator or a function?
41. what is short circuiting in c
42. What is static linking and dynamic linking
43. What are the advantages of dynamic linking
44. If a instruction contains both unsigned and signed integers. How is the operation executed
45. What happens when recursion functions are declared inline
46. Can structures be passed to the functions by value
47. Why cannot arrays be passed by values to functions
48. What are different storage classes in C and explain them. What information does they provide about the variable
49. What are function pointers. Give an example by declaring a function pointer. How do you call a function by using this pointer. what is the need to call in this way instead of calling a function directly

Solutions


1. What is the pdf of MAX(X,Y)

Depends on the

2. What is the pdf of MIN(X,Y)

Delay spread.

No comments:

Post a Comment