Tuesday, October 9, 2007

101 Interview Questions vip

101 Frequently Asked Placement Interview Questions on Programming

Most Important Questions which can

Change your Life !!!


 


 


 

Topics


C and Data Structures


Frequently Asked Programs


C++


Java


 

Most Important C Questions


 

1. What are the Different Types of Programming languages?

2. What is the difference between Pointer of Array and Array of Pointers?

3. What are Macros and Preprocessor ? What is the difference between them?

4. What does Assert Library do?

5. What are the various Storage Classes in C?

6. What is the difference between extern and Volatile variable?

7. Can a Static variable be defined outside the program?

8. What is the difference between malloc() and calloc()?

9. Can we use variables inside a switch statement?

10. What is the difference between enumeration variables and the preprocessor

#defines?

11. What is the difference between gets() and fgets()? What is the correct way to use

fgets() when reading a file?

12. What does Printf and Scanf returns ? What does malloc returns ?

13. Why should one use strncpy() and not strcpy()? What are the problems with

strncpy()?

14. What do setjmp() and longjump() functions do?

15. What is a NULL pointer and how does it work?

16. What's the difference between const char *p, char * const p and const char * const

p?

17. What is a void pointer? Why can't we perform arithmetic on a void * pointer?

18. What is a dangling pointer? What are reference counters with respect to pointers?

19. What do pointers contain?

20. What operations are valid on pointers? When does one get the Illegal use of

pointer in function error?

21. Why is sizeof() an operator and not a function?

22. What are function pointers?

23. How can I return multiple values from a function?

24. What are inline functions?

25. Can we declare a function that can return a pointer to a function of the same type?

26. How can I write a function that takes a variable number of arguments? What are

the limitations with this? What is vprintf()?

27. How can we find out the length of an array dynamically in C?

28. Write a C program to count bits set in an integer?

FAQ on Placements by www.ajay-onlinebooks.blogspot.Com

2

© http:// www.ajay-onlinebooks.blogspot.Com

29. How to reverse the odd bits of an integer?

30. What is GDB? How do you use it?

31. What are makefiles ? Why are they used?

32. What is the difference between statically linked libraries and dynamically linked

libraries (dll) ?

33. What is hashing? What are the different types of Hashing?

34. What are the different sorting algorithms? Tell them with there time complexities.

35. Explain the memory diagram in C? How it memory distributed to a program?

36. What do you mean by scope and duration?

37. How to find whether a machine is a Big Endian or little Endian?

38. What does memmove() and memopy() function do?

39. What is heap sort?

40. How to sort when the objects are bigger than memory? What is external sortying?


 

Frequently Asked Programs in C


 

41. Write a C program to reverse a string

42. Write a C program to swap two variables without using a temporary variable

43. Write a C program to reverse the words in a sentence.

44. Write C code to check if an integer is a power of 2 or not in a single line?

45. Find the duplicate integer in an array in O(1) time

46. Write C code to dynamically allocate one, two and three dimensional arrays

(using malloc())

47. Write C code to implement the Binary Search algorithm.

48. Write your own printf() function in C.


 

Data Structures


 

49. Reverse a singly linked list using only one variable? Reverse it using recursion?

50. Given only a pointer to a node to be deleted in a singly linked list, how do you

delete it?

51. How do you sort a linked list? Write a C program to sort a linked list.

52. How would you detect a loop in a linked list? Write a C program to detect a loop

in a linked list

53. How do you find the middle of a linked list?

54. Write a C program to return the nth node from the end of a linked list

55. How to read a singly linked list backwards?

56. Write a C program to find the depth or height of a tree? Find the nodes of the

tree?

57. Write C code to determine if two trees are identical

58. Write a C program to find the minimum value in a binary search tree

59. Write a C program to compute the maximum depth in a tree?

60. Write a C program to create a copy of a tree

61. What is Preorder, Inorder and Postorder traversal? Print the Tree in all three

orders

62. How many different trees can be constructed using n nodes?

63. Implement Breadth First Search (BFS) and Depth First Search (DFS)


 

C++


 

64. What are Objects? What is Class? What is the difference between structure and

Class?

65. What is Data Abstraction and Data encapsulation?

66. State all the class access modifiers and explain each one of them

67. What are Vectors in C++ and how are they used?

68. What are containers in C++? Which objects are available as containers?

69. What are References in C++ and how are they different from Pointers?

70. What is the Exception Handling mechanism in C++? What is Try and Catch in

C++?

71. What is Operator Overloading in C++?

72. What are Friend Functions and Friend Classes in C++?

73. What are Constructors and Destructors in C++?

74. What is Inheritance? How is a Class Inherited in C++?

75. What are Virtual Functions? Why do we need Virtual Functions? Explain with an

example

76. What are Templates in C++? How are Templates declared and used?

77. What is Polymorphism? How is Polymorphism achieved in C++?

78. What is Multiple Inheritance in C++? Explain with an example

79. How is memory allocation and de-allocation done in C++?

80. What is procedural programming?

81. What is Function Overloading in C++?

82. What is the Difference between Overloaded Functions and Overridden Functions?

83. What are Mutable and Const in C++

84. What is 'this' Pointer (object) in C++

85. What is Scope Resolution Operator?

86. What is a Pure Virtual Member Function?

87. Explain various access specifies like private, public, protected and there scopes in

C++

88. What is a forward reference in C++?

89. What is the difference between a deep copy and a shallow copy?

You can Get Answers of all these C++ Questions at


 

Java


 

90. What is a class and package in Java? Explain difference between them

91. Explain the differences between interface and class in Java

92. Give differences between early binding and late binding in Java?

93. Explain Memory management of Java and How it is different from say C++

94. Can RuntimeExceptions be caught in Java?

95. Explain Serialization mechanism in Java?

96. What are the names of access control specifiers in Java?

97. What are the differences between C++ and Java?

98. What are the advantages of polymorphism in Java?

99. What is multiple inheritance? Does Java Support Multiple Inheritance or not?

100. What is finalize in Java and it's importance?

101. What are the difference between Set and List.in Java ?

You can get Answer to all these Java Questions and Many more at


 

Final Words – These are only very limited set of questions which we feels are very

important and frequently asked but there are many more similar questions which you may

want to know. For that do check www.ajay-onlinebooks.blogspot.Com

You are welcome to tell us how did you liked the book and what else can be added in it.

We will create many such books for your references in coming time.

Cheers