Friday, September 23, 2011

Interview Questions for Software Engineers

C and C+ questions.

1. why C is used for as a programming language? what are demerits of C language?

2. why C++ is still unable to replace C in the current industry?

3. what is the main disadvantage of c++?

4. what is a difference between sizeof and strlen?

5. How many keywords do C have? Is printf/scanf are keywords?

6. what is the main disadvantage of malloc function?

7. what is a use of a 'header file'?

8. what do the printf statement exactly do?

9. what are variadic functions? Can you give an example or write one for yourself?

10. what is #pragma and why it is used?

11. why do you need a getch() or getche() for turbo C??

12. State a disadvantage of usage of local and global variable.

13. what is advantage of recursive function? why recursive functions are generally not used?

14. what will happen if I create a global array like int array[10000000000000000000000000000000000000000000000000000];

15.what is memory leak? why it should be avoided? what kind of error it can cause in the system? Can you give a practical example?

16. what is buffer overflow? how and why it should be avoided? write a code to avoid buffer overflow for an array.

17. what is 'volatile'? why it is required?

18. what is difference between static functions and normal functions?

19. Can 'extern' be applied to a local variable?

20. what is a 'linker' error?

21. how will you reduce the size of Ram which a program occupies in memory? Give some techniques ?

22. what is stack underflow? how it impacts a system?

23. why do you need 'data-structures'? where is link-lists used?

24. when is dynamic memory allocation is needed? Give example

25. what is 'ELF' file?

26. why 'Macros' are needed in a program? why it is part of C language?

27. what are the difference between structures in C and structures in C++?

28. what is 'lexical analysis'?

29. what is 'preprocessing'?

30. what is a FIFO? how will you use that?

31. what is a 'cross-compiler'?

32. what is a 'constant pointer'? how it is different from pointer to const?

33. write a program to show the usage of 'pointer to const'.

34. what is 'stack dump'? why it is important?

35. what makes C a tough language?

36. write a program for atoi function.

37.write a program for strstr/strlen/strchr/strcat functions.

38. write a macro to count the number of bytes in an integer/float/double.

39. reverse a linklist without traversing the list more than once.


Operating System Questions :

1. Difference between task /threads/process?

2. Different scheduling techniques.

3. why 'timers' are required in Operating systems? Give one usage of timers?

4. how does a system maintains time even after it is switched off?

5. what is a micro-kernel?

6. Difference between RTOS and OS.

7. what are different states of a process in Linux?

8.what is a 'zombie' process?

9. what is 'spinlock' in linux? how it is used?

10. what are interrupts? difference between hardware and software interrupts?

11. what do you mean by 'Edge-triggered' interrupt?

12. when do you disable interrupts?

13. Difference between interrupt and polling? when and why its is used?

14. How would you suspend a process in Linux?

15. what are different types of IPC?

16. Can two or more operating system run on a single system at the same time?

17. what is a binary semaphore? why it is required?

18. what is 'Mutex' and why it is used?

19. what is 'Reentrancy'?

20. Give techniques to stop deadlocks.

21. what is a file descriptor? Can a child process write into a file created by its own parent process?

22. Describe File structures - Inode table,File table for Unix.

23. what is 'swapping'?

24. what is 'debouncing'?

25. what is 'ps -a ' command in linux?