Embedded SW Interview Questions

Preview:

DESCRIPTION

 

Citation preview

Embedded Systems Eng. Mohammed Sokkaree

Agenda

• Introduction to embedded Systems

• Why embedded C

• Interview questions

• Q&A

Computing Systems

What’s ES?

• System designed to do one or a few dedicated and/or specific functions.

• combination of computer hardware and software

▫ Mp3 player

▫ Mobile

▫ Medical testing systems

▫ Anti-Lock Brakes

Embedded SW

• Portability

• Optimization

• Quality

• Readability

• Complexity

• HW Compatibility “ HW knowledge”

• Min. Resources

Why embedded C?

Question 1

RTD

Question 1

• Real time System

▫ Hard

▫ Soft

• CBT

Question 2

SWE

Question 2

• Testing

▫ Types of testing

• Debugging

Question 3

Pointers

Pointers Pointers & Pointers

• Using the variable a, give definitions for the following: ▫ a) An integer ▫ b) A pointer to an integer ▫ c) A pointer to a pointer to an integer ▫ d) An array of 10 integers ▫ e) An array of 10 pointers to integers ▫ f) A pointer to an array of 10 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

Answer

• a) int a; // An integer • b) int *a; // A pointer to an integer • c) int **a; // A pointer to a pointer to an integer • d) int a[10]; // An array of 10 integers • e) int *a[10]; // An array of 10 pointers to integers • f) int (*a)[10]; // A pointer to an array of 10 integers • g) int (*a)(int); // A pointer to a function a that takes

an integer argument and returns an integer

• h) int (*a[10])(int); // An array of 10 pointers to functions that take an integer argument and return an integer

Question 4

Macros

Question 4

Functions Function like macros

How it works

Input arguments

Question 4 (Cont.)

• Write a macro to set the MSB

#define MSB(X) ((X) | (1 << ((sizeof(X)<<3) -1))

Question 5

Variables

Question 5

• Local

• Global

• Static

• Extern

Question 6

Tracing

Question 6

X Y

2

1

3 1

4 1

5 1

6 1

7 0

int main() { int x=1,y=1; for(;y;printf("%d %d\n",x,y)) y=x++<=5; return 0; }

Thank you

Connect via LinkedIn

http://eg.linkedin.com/in/engmohammed

Hi all, I have a basic C programming query. For the program, #define MAX(x,y) (x)>(y)?(x):(y) void main( ) { int i=10, j=5, k=0; k=MAX(i++,++j); printf("%d %d %d",i,j,k); } I get the output as 12,6,11 whereas, when I modify the program as below int max_fn(a,b); void main( ) { int i=10, j=5, k=0; k = max_fn(i++,++j); printf("%d %d %d",i,j,k); } int max_fn(a,b) { return((a)>(b)?(a):(b)); } In this case, I get the output as 11,6,10.

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Recommended