Showing posts with label Imp Questions. Show all posts
Showing posts with label Imp Questions. Show all posts

Monday, March 19, 2012

Some more questions on Interview

1. Write the syntax of function pointer. Then write a function how to use declare, define and use the function pointer.
2. Take 2 string and contactinate with out using the library functions
copy one string to another string.
3. Difference between structure and union. gave a structure decalration and union declaration and asked to say the difference. how to assign the values or initialize a structure members and union members. what is the size of the structure of the given structure and the given union.
4. What is static? what happens if a variable is declared with the storage class static and what happens if the function is declared as static and what happens if the a function pointer is declared as static.
5. How to know the size of the 'int' of a particular micro controller whose int size is not known(1bit or 32bit) without using the sizeof operator.
6. if extern declaration is made in a .h file do we need to include this .h in the .c file?
7. If a static variable is declared both globally and locally in a function. then when we are using that varible in the function which variable will be considered whether the local variable or global variable?
8. How a volatile variable is used give one usecase how to use?
9. What is an inline function? what is the differnce between inline and macro? which will be better?
10. AUTOSAR archetecture where our modules lye and what are upper layers to that?
11. Write a macro to in generic way to set and bit and reset a bit.
12. write a function to mask nth bit of the number(set and reset).
13. questions regarding typecasting
14. CAN - how to gain the bus. and how to know which node had gained the bus.
Describe the field of the CAN frame
15. how to add two numbers using bitwise operators
16. Where the global, static, local variables are allocated in the RAM. What heap ares contais?
17. fibonic series program logic

strcpy(p, q)

strcpy(char *src, char *dst)
{
while(*src++ =! '\0')
{
*dst++ = *src++;
}
}

strcpy(p, q)

strcpy(char *src, char *dst)
{
while(*dst++ =! '\0')
{
*src++ = *dst++;
}
}

main()
{
int f1, f2, f3;
f1 = 0;
f2 = 1;
while(i != 8)
{
f3 = f2 + f1;
f1 = f2;
f2 = f3;
}
}

Set(int n)
{
return((data) || (01 << n));
}

Reset(int n)
{
return((data) && ~(01 << n));
}

Learn this and get job

Interview Questions:
1. What are static variables?
2. What are volatile variables?
3. What do you mean by const keyword ?
4. What is interrupt latency?
5. How you can optimize it?
6. What is size of character, integer, integer pointer, character pointer?
7. What is NULL pointer and what is its use?
8. What is void pointer and what is its use?
9. What is ISR?
10.What is return type of ISR?
11.Can we use any function inside ISR?
12.Can we use printf inside ISR?
13.Can we put breakpoint inside ISR?
14.How to decide whether given processor is using little endian format or big endian format ?
15.What is Top half & bottom half of a kernel?
16.Difference between RISC and CISC processor.
17.What is RTOS?
18.What is the difference between hard real-time and soft real-time OS?
19.What type of scheduling is there in RTOS?
20.What is priority inversion?
21.What is priority inheritance?
22.How many types of IPC mechanism you know?
23.What is semaphore?
24.What is spin lock?
25.What is difference between binary semaphore and mutex?
26.What is virtual memory?
27.What is kernel paging?
28.Can structures be passed to the functions by value?
29.Why cannot arrays be passed by values to functions?
30.Advantages and disadvantages of using macro and inline functions?
31.What happens when recursion functions are declared inline?
32.#define cat(x,y) x##y concatenates x to y. But cat(cat(1,2),3) does not expand but gives
preprocessor warning. Why?
33.Can you have constant volatile variable? Yes, you can have a volatile pointer?
34.++*ip increments what? it increments what ip points to
35.Operations involving unsigned and signed — unsigned will be converted to signed
36.malloc(sizeof(0)) will return — valid pointer
37.main() {fork();fork();fork();printf("hello world"); } — will print 8 times.
38.Array of pts to functions — void (*fptr[10])()
39.Which way of writing infinite loops is more efficient than others? there are 3ways.
40.Who to know whether system uses big endian or little endian format and how to convert
among them?
41.What is forward reference w.r.t. pointers in c?
42.How is generic list manipulation function written which accepts elements of any kind?
43.What is the difference between embedded systems and the system in which RTOS is running?
44.How can you define a structure with bit field members?
45.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?
46.Which parameters decide the size of data type for a processor ?
47.What is job of preprocessor, compiler, assembler and linker ?
48.What is the difference between static linking and dynamic linking ?
49.How to implement a WD timer in software ?

Important questions

1. What is linker , input files to linker
2. What is interrupt
3. difference between interrupt and function
4. Can we define the variable storage location?
5. what is multiplexer speed
6. design an surviellance system
7. can multiplexer o/p can be i/p
8. SPI
9. Synchronous and asynchronous communication
10. what do you minimize runtime
11.do you use nested interrupts
12. How do u design stack
13. what is stored in stack
14. control the automobile headlights schematics
15. types of motors
16. types of dc motors
17. which sensors you used in project
18. what is PWM
19.do while syntax
20. While syntax
21. interrupt syntax
22. types of interrupts
23.compiler
24.can we control variable storage
25. what is negative and positive testing
26. different types of models waterfall/spiral/v&v
27.what is ram & rom size of lpc2148
28.close loop and open loop?