Given Below are some of the interview questions I encoutered ,and I am putting it here for my future use..
1.What is the size of below structure if int is 4 bytes long?
struct {
int a;
char b;
int c;
};
Ans:4+4+4=12;
2.Why is it now 4+1+4=9?
Ans: Due to word Alignment and padding of char b which makes it size of 4 bytes.
3.How can you avoid padding.?
Ans:It depends on compiler.Some compiler eg Diab compiler. provide compiler directive such as "__packed__" to avoid padding
so
__packed__ struct
{
int a;
char b;
int c;
}A;
Now the size of A is 4+1+4=9;
4.aow can u determine whether the number is a multiple of 2;
Ans: The last bit (LSB) of the number should be 0(zero),
Friday, February 23, 2007
Thursday, March 16, 2006
some lines on confidence building
1.confident people inspires others,show confidence.
2.Avoid individuals who suck your energy and diminish your confidence
3.WHEN you have lost.
sitting arround and thinking about your loss is the worst thing you can
do to solve your problem.
4.ABOUT what you WEAR "dress code".
you don't do things to dazzle someone ,but to build confidence in advance of victory.
5.keep positive line ringing in your head to stay confident.
atheletes and sports person do this. ring winning bell.
2.Avoid individuals who suck your energy and diminish your confidence
3.WHEN you have lost.
sitting arround and thinking about your loss is the worst thing you can
do to solve your problem.
4.ABOUT what you WEAR "dress code".
you don't do things to dazzle someone ,but to build confidence in advance of victory.
5.keep positive line ringing in your head to stay confident.
atheletes and sports person do this. ring winning bell.
Wednesday, March 15, 2006
GOOD BAD &U
From very beginning of life, DOs and DONTs come up in our life.Have you ever asked yourself that from where they come .Our parents inherit them ofcource from their parents and so on.
Going deeper is even tuff for me.So let me say the things in the way I look at them.One thing which governs GOOD and BAD is our justification to ourself.How do we justify things to ourself.Whenever we decide upon something to do,we are always supported by our own reasons.Every thing we say and do ,has a reason attached to it,a solid backup.
Why people go for so called socially unacceptable things,simple they justify to themselves.They have their own priority stack and reasons supporting their moves.
I won't give any concrete examples ,it is reader's duty to have find their own.
NB:this is my first post...but(i hate to use but) first impression should not be ur last one.
things change ,technology change ,human change too..na!!
Going deeper is even tuff for me.So let me say the things in the way I look at them.One thing which governs GOOD and BAD is our justification to ourself.How do we justify things to ourself.Whenever we decide upon something to do,we are always supported by our own reasons.Every thing we say and do ,has a reason attached to it,a solid backup.
Why people go for so called socially unacceptable things,simple they justify to themselves.They have their own priority stack and reasons supporting their moves.
I won't give any concrete examples ,it is reader's duty to have find their own.
NB:this is my first post...but(i hate to use but) first impression should not be ur last one.
things change ,technology change ,human change too..na!!
Subscribe to:
Posts (Atom)