Friday 18 November 2011

Honeywell Technical Interview Questions

1. Introduce yourself briefly.


2. How much good you are in C (on the scale of 1-10)


3. They gave me the same complex number program and told me what modification I can do in it. (Again write the program) Click here to see this program


4. Write the same complex number addition program with passing values to function, passing structure to function and passing address of the structure to the function.


5. What is recursion? What will happen is we don't give termination condition? How efficient recursion is compared to iteration.


ans:


Recursion is a programming technique that allows the programmer to express operations in terms of themselves. In C++, this takes the form of a function that calls itself. A useful way to think of recursive functions is to imagine them as a process being performed where one of the instructions is to "repeat the process". This makes it sound very similar to a loop because it repeats the same code, and in some ways it is similar to looping. On the other hand, recursion makes it easier to express ideas in which the result of the recursive call is necessary to complete the task. Of course, it must be possible for the "process" to sometimes be completed without the recursive call. One simple example is the idea of building a wall that is ten feet high; if I want to build a ten foot high wall, then I will first build a 9 foot high wall, and then add an extra foot of bricks. Conceptually, this is like saying the "build wall" function takes a height and if that height is greater than one, first calls itself to build a lower wall, and then adds one a foot of bricks.


6. What are the storage classes? Explain each with examples.


C has a concept of 'Storage classes' which are used to define the scope (visability) and life time of variables and/or functions.


There are four type of storage classes in C. These are used
to store variables. These are Extern, Static, Register and
Auto. Auto is the default class assigned to any variable.
eg. if we define int x=10; then it means auto int x=10
register and static differ in only one grounds that
register is there in the cpu and static in the main memory.
extern is global and can be accessed by any program and
anywhere.


7. Where register variables are stored? Where registers remain in computer? How many registers are there?






register is there in the cpu and static in the main memory.


8. Write a program to implement static storage class. (Many questions on this)


9. What is Union? Write syntax of union. How memory is allocated for the members of Union. How it is different from structure? When we use union and when structure.


10. What is dynamic memory allocation?


11. Write syntax for allocating memory for Integer using malloc().


12. What is type casting?


13. What is the need of type casting in malloc().


12. What is difference between malloc() and calloc().


13. How memory is released?


14. Where malloc() save variables? (In which memory- Primary, RAM)


15. What is Preprocessor?


16. What it is called in C?


17. How it works? What is the need of macros?


18. How parameters are passed in C?

Search here for "Freshers Jobs"