25
Embedded Systems Eng. Mohammed Sokkaree

Embedded SW Interview Questions

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Embedded SW Interview Questions

Embedded Systems Eng. Mohammed Sokkaree

Page 2: Embedded SW Interview Questions

Agenda

• Introduction to embedded Systems

• Why embedded C

• Interview questions

• Q&A

Page 3: Embedded SW Interview Questions

Computing Systems

Page 4: Embedded SW Interview Questions

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

Page 5: Embedded SW Interview Questions

Embedded SW

• Portability

• Optimization

• Quality

• Readability

• Complexity

• HW Compatibility “ HW knowledge”

• Min. Resources

Page 6: Embedded SW Interview Questions

Why embedded C?

Page 7: Embedded SW Interview Questions

Question 1

RTD

Page 8: Embedded SW Interview Questions

Question 1

• Real time System

▫ Hard

▫ Soft

• CBT

Page 9: Embedded SW Interview Questions

Question 2

SWE

Page 10: Embedded SW Interview Questions

Question 2

• Testing

▫ Types of testing

• Debugging

Page 11: Embedded SW Interview Questions

Question 3

Pointers

Page 12: Embedded SW Interview Questions

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

Page 13: Embedded SW Interview Questions

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

Page 14: Embedded SW Interview Questions

Question 4

Macros

Page 15: Embedded SW Interview Questions

Question 4

Functions Function like macros

How it works

Input arguments

Page 16: Embedded SW Interview Questions

Question 4 (Cont.)

• Write a macro to set the MSB

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

Page 17: Embedded SW Interview Questions

Question 5

Variables

Page 18: Embedded SW Interview Questions

Question 5

• Local

• Global

• Static

• Extern

Page 19: Embedded SW Interview Questions

Question 6

Tracing

Page 20: Embedded SW Interview Questions

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; }

Page 21: Embedded SW Interview Questions
Page 22: Embedded SW Interview Questions

Thank you

Page 23: Embedded SW Interview Questions

Connect via LinkedIn

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

Page 24: Embedded SW Interview Questions

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.

Page 25: Embedded SW Interview Questions

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