0% found this document useful (0 votes)
19 views

Embedded-Interview-Questions

Uploaded by

Technical Novice
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Embedded-Interview-Questions

Uploaded by

Technical Novice
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

http://s.eeweb.

com/members/abeer_habeeb/answers/1316084160-Interview-
questions.pdf

Question
Rating
View Answer
a+++b -> (a++)+b

View Answer
What is forward reference w.r.t. pointers in c?

View Answer
Can you have constant volatile variable?

View Answer
What are the different storage classes in C?

View Answer
What are the 4 different types of inheritance relationship?

View Answer
What are the features different in pSOS and vxWorks?

View Answer
#define cat(x,y) x##y concatenates x to y. But cat(cat(1,2),3) does not expand but gives preprocessor warning. Why?

View Answer
What are the different qualifiers in C?

View Answer
malloc(sizeof(0)) will return ? valid pointer

View Answer
Multiple inheritance - objects contain howmany multiply inherited ancestor?

View Answer
Difference between object oriented and object based languages?

View Answer
What will this return malloc(sizeof(-10))

View Answer
++*ip increments what? it increments what ip points to

View Answer
Advantages and disadvantages of using macro and inline functions?

View Answer
What are the different BSD and SVR4 communication mechanisms

View Answer
How is generic list manipulation function written which accepts elements of any kind?

View Answer
Which way of writing infinite loops is more efficient than others?

View Answer
Why cannot arrays be passed by values to functions?

View Answer
How is function itoa() written?

View Answer
Can structures be passed to the functions by value?

View Answer
Question
Rating
View Answer
How do you write a function which takes 2 arguments - a byte and a field in the byte and returns the value of the field
in that byte?

View Answer
How would you find out the no of instance of a class?

View Answer
What is interrupt latency? How can you recduce it?

View Answer
Order of constructor and destructor call in case of multiple inheritance?

View Answer
How can you define a structure with bit field members?

View Answer
Operations involving unsigned and signed ? unsigned will be converted to signed

View Answer
Who to know whether system uses big endian or little endian format and how to convert among them?

View Answer
What is the difference between hard real-time and soft real-time OS?

View Answer
How many nuclear plants are there in India and what are they? which place they are located?

View Answer
What is the output of printf(" abcd ef"); -> ef

View Answer
What is the differnce between embedded systems and the system in which rtos is running?

View Answer
What happens when recursion functions are declared inline?

View Answer
Can u have inline virtual functions in a class?

View Answer
When you inherit a class using private keyword which members of base class are visible to the derived class?

View Answer
Is java a pure object oriented language? Why?

View Answer
What are set up time & hold time constraints? What do they signify? Which one is critical for estimating maximum clock
frequency of a circuit?
View Answer
Explain Order of constructor and destructor call in case of multiple inheritance?

View Answer
Explain What are the different qualifiers in C?

View Answer
Explain What is forward reference w.r.t. pointers in c?

View Answer
How is function itoa() written in C?

View Answer

Question
Rating
View Answer

Scope of static variables?

View Answer

What is interrupt latency?

View Answer

Explain Operations involving unsigned and signed? unsigned will be converted to signed?

View Answer

Error ? what it does?

View Answer

How to define a structure with bit field members?

View Answer

Explain What happens when recursion functions are declared inline?

View Answer

Explain What are the 5 different types of inheritance relationship?

View Answer

Explain Scope of static variables?


View Answer

Explain What is the difference between embedded systems and the system in which RTOS is running?

View Answer

Explain Scope of static variables?

View Answer

Explain what is interrupt latency? How can we reduce it?

View Answer

Explain What is interrupt latency?

View Answer

Explain What is forward reference w.r.t. pointers in c?

View Answer

Explain What happens when recursion functions are declared inline?

View Answer
Explain Operations involving unsigned and signed? unsigned will be converted to signed?

View Answer
Explain Order of constructor and destructor call in case of multiple inheritance?

View Answer
Explain What are the features different in pSOS and vxWorks?

View Answer
Explain Difference between object oriented and object based languages?

View Answer
What are the advantages and disadvantages of using macro and inline functions?

View Answer
Explain Why cannot arrays be passed by values to functions?

View Answer
Question
Rating
View Answer
Explain what is interrupt latency? How can we reduce it?
View Answer
Explain What are the different qualifiers in C?

View Answer
Explain What are different qualifiers in C?

View Answer
Explain What are the 5 different types of inheritance relationship?

View Answer
Explain What will this return malloc(sizeof(-10))?

View Answer
Explain Can structures be passed to the functions by value?

View Answer
Explain Can we have constant volatile variable?

View Answer
Explain Can we have constant volatile variable?

View Answer
Explain What are the different storage classes in C?

View Answer
How is function itoa() written in C?

View Answer
Explain What is the difference between embedded systems and the system in which RTOS is running?

View Answer
How to define a structure with bit field members?

View Answer
Explain What is interrupt latency?

View Answer
Explain Scope of static variables?

View Answer
Explain What are the features different in pSOS and vxWorks?

View Answer
Explain Difference between object oriented and object based languages?

View Answer
Explain Why cannot arrays be passed by values to functions?

View Answer
Explain What are different qualifiers in C?

View Answer
Explain What are the 5 different types of inheritance relationship?

View Answer
Explain What are the 5 different types of inheritance relationship?

View Answer
Question
Rating
View Answer
Explain What will this return malloc(sizeof(-10))?

View Answer
Explain Can structures be passed to the functions by value?

View Answer
Explain Can we have constant volatile variable?

View Answer
Explain What are the different storage classes in C?

View Answer
Explain What is forward reference w.r.t. pointers in c?

View Answer
how to improve performance of processor in embedded system design

View Answer
Question :
a+++b -> (a++)+b
Category Embedded Systems Interview Questions
Rating (0.4) By 1458 users
Added on 7/6/2005

Views 3074

Rate it!
Answers:

both are not equal

Posted by: g.durga

Contact g.durga

Both are equal

Because a+++b will be converted to (a++)+b

Posted by: jeyaraj

Contact jeyaraj

Both are not equal, to know that do the following example


int a = 10,b = 20,c;
c=a+++b;
printf(" the result of a+++b is %d ",c);

c=(a++)+b;
printf(" the result of (a++)+b is %d ",c);

Then the results are 30 and 31.

Posted by: krishna

Contact krishna

i solved this problem in my system. both are equal

Posted by: nag

Contact nag

when we do it with GCC


both will give the same result

Posted by: chandra

Contact chandra

Both are not equal, to know that do the following example


int a = 10,b = 20,c;

c=a+++b; //here a++ is post increment where as ++b is pre but ++b has to be incremented
after incrementing a, where in single statement it is not possible.
printf(" the result of a+++b is %d ",c);

c=(a++)+b;
printf(" the result of (a++)+b is %d ",c);

Then the results are 30 and 31.

Posted by: Munish Bhardwaj

Contact Munish Bhardwaj

priority of ++ is higher than +. also ++ has R-L associativity & +,() has L-R associativity.
hence both the answers will be different
Posted by: chethan

Contact chethan

Both the values are equal....


to verify
1.first execute C only.
2.execute d only.
you will find both the values to be equal

{
int a = 10,b = 30,c;
//c=a+++b;

//d=(a++)+b;
}

Posted by: pramod d

Contact pramod d

both are not equal


because in a+++b.......it is from l-r so it is post incremented.
but in (a++)+b first incrmenting the a value after add with b.

Posted by: ashok

Contact ashok

both are equal because when u solve


(a++)+b,hear a++ is within braces but still as the ++ is an post increament so it gives result 30
as if a=10 and b=20 and 1st one also give 30 as result.....

Posted by: anil kumar

Contact anil kumar

int a = 5, b = 7, c;
c = a+++b;
This question is intended to be a lighthearted end to the quiz, as, believe it or not, this is
perfectly legal syntax. The question is how does the compiler treat it? Those poor compiler
writers actually debated this issue, and came up with the "maximum munch" rule, which
stipulates that the compiler should bite off as big (and legal) a chunk as it can. Hence, this
code
is treated as:
c = a++ + b;
Thus, after this code is executed, a = 6, b = 7, and c = 12.
If you knew the answer, or guessed correctly, well done. If you didn't know the answer then I
wouldn't consider this to be a problem. I find the greatest benefit of this question is that it is
good for stimulating questions on coding styles, the value of code reviews, and the benefits of
using lint.

Posted by: divya

Contact divya

both are not equal..

#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=20;
clrscr();
printf("a+++b=%d ",a+++b);
printf("(a++)+b=%d",(a++)+b);
getch();
}

o/p:
a+++b=30
(a++)+b=31

Posted by: arvind singh

Contact arvind singh

both are equal


if first first evaluate the another execute then it increase the value by pre-increment then the
answer is 30 and 31 if after one statement you again assign the same value then result is same
eg
a=10,b=20;
then a+++b=30
and (a++)+b=31
but if
a=10,b=20
a+++b=30
again
a=10,b=20
then (a++)+b=30
a+++b=30
Posted by: md asif

Contact md asif

both are equal


bcoz if u use (a++)+b only one time in programme so a+++b and (a++)+b is same bcoz a++ is
post increment,
if these values repeat in programme answer is different

Posted by: rahul upadhyay

Contact rahul upadhyay

Both are equal.


Don't be confused, it's not a compiler issue.
Print one by one both values and u'll find them same.
either,
cout << "a+++b" << a+++b<<endl;
or,
cout << "(a++)+b" << (a++)+b<<endl;

when u'll print both values at same time, a value 'll be incremented and u'll different answers.

Posted by: Ankit Mishra

Contact Ankit Mishra


Question :
What is forward reference w.r.t. pointers in c?
Category Embedded Systems Interview Questions
Rating (0.4) By 1156 users
Added on 7/6/2005

Views 3186

Rate it!
Answers:

int a=10;
int *p=&a;
*p is called forward Reference.........
Posted by: manik

Contact manik

Pointer use's to reference to value a into int a=10 to memory add this value and 10 is add p
value added this data in memory location for p............for reference key is a

Posted by: pankaj

Contact pankaj
Question :
Can you have constant volatile variable?
Category Embedded Systems Interview Questions
Rating (0.4) By 1097 users
Added on 7/6/2005

Views 3615

Rate it!
Answers:

yes we can have constant volatile variable.

In this current context of code will not change the value of the variable but out side of the
program i.e. hardware registers can change it.

Posted by: rajkumar

Contact rajkumar

In some scenarios expressions having volatile variables cant be optimized by a compiler.

Posted by: shashank vimal

Contact shashank vimal

precisely volatile variable warns the compiler that the value of the variable may change at any
time without the knowledge of the compiler, to the code currently executed.
volatile int * const port_add = 0x400;
Posted by: Murali Prasath

Contact Murali Prasath

Volatile type tell the compiler , this variable can be changed by any external tasks, So do not
optimize while compiling and linking final executable.
Here is Example:

In Embedded system System Timer is one of the most important.

func()
{
TIME* time;
time = GetSystime();

for ( 1000 times )


{
some expressions;
}
time = GetSystime();
}

In the above function , time is a structure which gets the time before and after FOR loop.
At these two instances time is definitely different, because of FOR loop. If you go for an
embedded system compiler, generally it optimizes the "time = GetSystime();" expression.
because it thought that, code is redundant no need to load the getsystime value again from
memory , if u dont use VOLATILE. to avoid this kind of things use Volatile.

Posted by: Jay

Contact Jay

Const and volatile keywords should not be used together because both are opposite in nature.
A variable is declared as "const" means it's value is not able to be changed but if it is declared
as "Volatile" then it is not under control.

Posted by: PadmavathB

Contact PadmavathB

You might also like