Saturday, March 10, 2007

C/C++ Questions

How do you write a program which produces its own source code as its output?

How can I find the day of the week given the date?

Why doesn’t C have nested functions?

What is the most efficient way to count the number of bits which are set in a value?

How can I convert integers to binary or hexadecimal?


How can I call a function, given its name as a string?

How do I access command-line arguments?

How can I return multiple values from a function?

How can I invoke another program from within a C program?

How can I access memory located at a certain address?

How can I allocate arrays or structures bigger than 64K?

How can I find out how much memory is available?

How can I read a directory in a C program?

How can I increase the allowable number of simultaneously open files?

What’s wrong with the call fopen(”c:\newdir\file.dat”, “r”)?

* Difference between arrays and pointers?

* What is the purpose of realloc( )?

* What is static memory allocation and dynamic memory allocation?

* How are pointer variables initialized?

* Are pointers integers?

* What is a pointer variable?

* What is a pointer value and address?

* What is a method?

* What are the advantages of the functions?

* What is the purpose of main( ) function?

* What is an argument ? differentiate between formal arguments and actual arguments?

* What is a function and built-in function?

* What is modular programming?

* When does the compiler not implicitly generate the address of the first element of an array?

* What are the characteristics of arrays in C?

* Differentiate between a linker and linkage?

* What are advantages and disadvantages of external storage class?

* Diffenentiate between an internal static and external static variable?

* What are the advantages of auto variables?

* What is storage class and what are storage variable ?

* Which expression always return true? Which always return false?

* Write the equivalent expression for x%8?

* What is the difference between text and binary modes?

* How can you restore a redirected standard stream?

* How do you redirect a standard stream?

* How can I search for data in a linked list?

* How can I sort a linked list?

* What is hashing?

* What is the quickest searching method to use?

* What is the easiest searching method to use?

* How can I sort things that are too large to bring into memory?

* What is the quickest sorting method to use?

* What is the easiest sorting method to use?

* What is the benefit of using const for declaring constants?

* Can static variables be declared in a header file?

* What is the difference between declaring a variable and defining a variable?

* Is it acceptable to declare/define a variable in a C header?

* When should a type cast not be used?

* When should a type cast be used?

* How can you determine the maximum value that a numeric variable can hold?

* How reliable are floating-point comparisons?

* Can a variable be both const and volatile?

* when should the volatile modifier be used?

* When should the register modifier be used? Does it really help?

C/C++ Questions

* why n++ executes faster than n+1?

* what is a modulus operator? What are the restrictions of a modulus operator?

* What is the difference between a string and an array?

* Is it better to use a pointer to navigate an array of values,or is it better to use a subscripted array name?

* Can the sizeof operator be used to tell the size of an array passed to a function?

* Is using exit() the same as using return?

* Is it possible to execute code even after the program exits the main() function?

* What is a static function?

* Why should I prototype a function?

* How do you print an address?

* Can math operations be performed on a void pointer?

* How can you determine the size of an allocated portion of memory?

* What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

* What is the difference between NULL and NUL?

* What is the heap?

* Can the size of an array be declared at runtime?

* What is the stack?

* When should a far pointer be used?

* What is the difference between far and near?

* Is it better to use malloc() or calloc()?

* Why should we assign NULL to the elements (pointer) after freeing them?

* When would you use a pointer to a function?

* How do you use a pointer to a function?

* Can you add pointers together? Why would you?

* What does it mean when a pointer is used in an if statement?

* Is NULL always defined as 0?

* What is a void pointer?

* What is a null pointer?

* How many levels of pointers can you have?

* What is indirection?

* How do you print only part of a string?

* How can I convert a string to a number?

* How can I convert a number to a string?

* What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

* How can you check to see whether a symbol is defined?

* How do you override a defined macro?

* What is #line used for?

* What is a pragma?

* What are the standard predefined macros?

* How can type-insensitive macros be created?

* How many levels deep can include files be nested?

* Can include files be nested?

* Can you define which header file to include at compile time?

* What is the difference between #include and #include file ?

* Is it better to use a macro or a function?

* How are portions of a program disabled in demo versions?

* What is the benefit of using an enum rather than a #define constant?

* What is the benefit of using #define to declare a constant?

* Can a file other than a .h file be included with #include?

* How can you avoid including a header more than once?

* What will the preprocessor do for a program?

* What is a macro, and how do you use it?

* What is Preprocessor?

* How can I make sure that my program is the only one accessing a file?

* How can I open a file so that other programs can update it at the same time?

* How do you determine whether to use a stream function or a low-level function?

JAVA QUESTIONS

1. How do I instantiate a bean whose constructor accepts parameters using the useBean tag?
2. Replacing Characters in a String?
3. Searching a String?
4. Connecting to a Database and Strings Handling?
5. What is a transient variable?
6. What is the difference between Serializalble and Externalizable interface?
7. How many methods in the Externalizable interface?
8. How many methods in the Serializable interface?
9. How to make a class or a bean serializable?
10. What is the serialization?
11. What are synchronized methods and synchronized statements?
12. What is synchronization and why is it important?
13. What is the purpose of finalization?
14. What classes of exceptions may be caught by a catch clause?
15. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
16. What happens when a thread cannot acquire a lock on an object?
17. What restrictions are placed on method overriding?
18. What restrictions are placed on method overloading?
19. How does multithreading take place on a computer with a single CPU?
20. How is it possible for two String objects with identical values not to be equal under the == operator?
21. How are this() and super() used with constructors?
22. What class allows you to read objects directly from a stream?
23. What is the ResourceBundle class?
24. What interface must an object implement before it can be written to a stream as an object?
25. What is Serialization and deserialization?
26. What are the Object and Class classes used for?
27. Can you write Java code for declaration of multiple inheritance in Java ?
28. What do you mean by multiple inheritance in C++ ?
29. Write the Java code to declare any constant (say gravitational constant) and to get its value.
30. What are the disadvantages of using threads?
31. Given two tables Student(SID, Name, Course) and Level(SID, level) write the SQL statement to get the name and SID of the student who are taking course = 3 and at freshman level.
32. What do you mean by virtual methods?
33. What do you mean by static methods?
34. What do mean by polymorphism, inheritance, encapsulation?
35. What are the advantages of OOPL?
36. How many methods do u implement if implement the Serializable Interface?
37. Are there any other ‘marker’ interfaces?
38. What is the difference between instanceof and isInstance?
39. Why do you create interfaces, and when MUST you use one?
40. What’s the difference between the == operator and the equals() method? What test does Object.equals() use, and why?
41. Discuss the differences between creating a new class, extending a class and implementing an interface; and when each would be appropriate.
42. Given a text file, input.txt, provide the statement required
43. Name four methods every Java class will have.
44. What does the “abstract” keyword mean in front of a method? A class?
45. Does Java have destructors?
46. Are constructors inherited? Can a subclass call the parent’s class constructor? When?
47. What synchronization constructs does Java provide? How do they work?
48. Why “bytecode”? Can you reverse-engineer the code from bytecode?
49. Does Java have “goto”?
50. What does the “final” keyword mean in front of a variable? A method? A class?
51. Access specifiers: “public”, “protected”, “private”, nothing?
52. What is JDBC? Describe the steps needed to execute a SQL query using JDBC.
53. What is RMI?
54. What are native methods? How do you use them?
55. What does the keyword “synchronize” mean in java. When do you use it? What are the disadvantages of synchronization?
56. How many different types of JDBC drivers are present? Discuss them.
57. What is the difference between a Vector and an Array. Discuss the advantages and disadvantages of both?
58. Describe java’s security model.
59. Java says “write once, run anywhere”. What are some ways this isn’t quite true?
60. What is the difference between an Applet and an Application?
61. How can you force all derived classes to implement a method present in the base class?
62. What are abstract classes, abstract methods?
63. What’s the difference between == and equals method?
64. Describe, in general, how java’s garbage collector works?
65. What is the difference between StringBuffer and String class?
66. How can you achieve Multiple Inheritance in Java?
67. What are interfaces?
68. What are the main differences between Java and C++?
69. In Java, You can create a String object as: String str = “abc”; & String str = new String(”abc”); Why cant a button object be created as : Button bt = “abc” Why is it compulsory to create a button object as: Button bt = new Button(”abc”); Why is this not compulsory in String’s case?
70. Why are Java ARchive (JAR) files important?
71. What is it reflection (introspection) ? Why is reflection possible in the Java language?
72. How to make application thread-safe ?
73. What is it object serialization?
74. What do you know about networking support in Java?
75. What you know about Corba implementation in Java?
76. What is Java Beans?
77. Compare SWING components to standard AWT.
78. What is layout manager ? How does it work?
79. What is the purpose of the toolkit in the Abstract Window Toolkit (AWT)? How does AWT work?
80. What are the differences between Java & C++ in terms of its features?
81. Is the ternary operator written x : y ? z or x ? y : z ?
82. What is the List interface?
83. What is the difference between an if statement and a switch statement?
84. What are the problems faced by Java programmers who don’t use layoutmanagers?
85. What are the two basic ways in which classes that can be run as threads may be defined?
86. What are synchronized methods and synchronized statements?
87. Which Component subclass is used for drawing and painting?
88. What methods are used to get and set the text label displayed by a Buttonobject?
89. What method must be implemented by all threads?
90. When is an object subject to garbage collection?
91. Can an unreachable object become reachable again?
92. How does a try statement determine which catch clause should be used tohandle an exception?
93. What are the Object and Class classes used for?
94. What modifiers may be used with a top-level class?
95. What is a Java package and how is it used?
96. What is the purpose of a statement block?
97. What is the difference between the prefix and postfix forms of the ++ operator?
98. Can try statements be nested?
99. To what value is a variable of the boolean type automatically initialized?
100. What is the difference between a public and a non-public class?

C/C++/JAVA / JSP QUESTIONS

102. Can you make use of a ServletOutputStream object from within a JSP page?
103. Can a JSP page instantiate a serialized bean?
104. Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?
105. What is the page directive is used to prevent a JSP page from automatically creating a session?
106. How do you prevent the Creation of a Session in a JSP Page and why?
107. How do I include static files within a JSP page?
108. How can I implement a thread-safe JSP page?
109. How do I mix JSP and SSI #include?
110. Can a JSP page process HTML FORM data?
111. What JSP lifecycle methods can I override?
112. How do I perform browser redirection from a JSP page?
113. Is there a way to reference the “this” variable within a JSP page?
114. Can I stop JSP execution while in the midst of processing a request?
115. How do I use comments within a JSP page?
116. How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
117. How does JSP handle run-time exceptions?
118. How do I use a scriptlet to initialize a newly instantiated bean?
119. How can I enable session tracking for JSP pages if the browser has disabled cookies?
120. How can I declare methods within my JSP page?
121. How can I set a cookie and delete a cookie from within a JSP page?
122. Is there a way I can set the inactivity lease period on a per-session basis?
123. How does a servlet communicate with a JSP page?
124. How do I have the JSP-generated servlet subclass my own custom servlet class, instead of the default?
125. How do you pass control from one JSP page to another?
126. How do you restrict page errors display in the JSP page?
127. How do you call stored procedures from JSP?
128. How do you connect to the database from JSP?
129. What is Declaration?
130. What is difference between scriptlet and expression?
131. What is jsp:use bean. What are the scope attributes & difference between these attributes?
132. What are the implicit objects in JSP & differences between them?
133. What are Custom tags. Why do you need Custom tags. How do you create Custom tag?
134. What is the difference between include directive & jsp:include action?
135. What are advantages of JSP?
136. What is JSP?
137. Can a single JSP page be considered as a J2EE application?
138. How to call EJB from JSP.
139. What is the architecture of JSP?
140. What is the difference between servlet session and jsp session?
141. Why should we setContentType() in servlet ?what is the use of that method?
142. When jsp is compiled into servlet, where the servlet is actually stored(storage location)?
143. How to generate BAR & PIE Graphs using JSP code…?
144. What is the diff. b/n declaring members in and declaraing in jspinit() method ?
145. How to check the value in the text field is not a number
146. what is the use of extends in jsp…we we want to import a class in current jsp file which i am working how can i do that …if i use extnds for that means how can i do that…pls explain me this
147. I have a String name & Map m, in my bean class. I have get & set methods on both. To Display the String name, i do The above one works fine. Te below one, displays the entire Map contents I know the KEY, how do i display the VALUE for that KEY
148. What is the difference between , pagedirective include, action tag include ?
149. What are the default objects provided by JSP container? Other than page, request, session and context objects.
150. What is the default scope of jsp tags?
151. When many Users are browsing the same application at the same time and they click the “Submit” button will many objects be created for each and every User?
152. What is the difference between Difference between doGet() and doPost()?
153. How do we perform redirect action without using response.sendRedirect(” “);
154. A] Is the response.sendRedirect ends the existing session? B] If I logged in to a site ( say a.com) & then in same browser window I type the url for another site (say b.com), then does my session gets ended on first site ( a. com ) ?
155. How to overwrite the init and destroy method in a jsp page.
156. Where do we use hidden variables and url rewriting? and wat is the difference between them?
157. What is the difference between session and cookie ?
158. How to pass java script array to jsp page?
159. What is the difference betweeen JSP forward and servlet forward methods?
160. Where can we find the compiled file of jsp in the directory struture.
161. How we abort jsp page from a servlet
162. What is difference between getAttribute() and getParameter()?
163. What is the diff. b/w PAGE,APPLICATION and SESSION implicit objects of JSP?
164. Wat is the difference between and in jsp..wen translate into servlet..wer it is stored in servlet..can we create global variables in jsp..if yes then how??
165. How can i restrict the user from Clicking of Back button in any browser
166. In one class i stored the key and values in the hashmap.so using key value i have to check wheter the value for key is correct or not.so how to retreive the key and values in jsp page
167. What is the differnce between application server and web server
168. What is use of implict Objects?why the container is given those one?
169. How to delete cookies in JSP?
170. In Oracle table some fields are “null”.By default it will show as “null” in JSP page text box.But i dont want that. I want as blank textbox.What i can do for that?
171. In Internet explorer if we give a jsp , How the server will know it has to execute?
172. How the jsp changes will be effected in servlet file after converting?
173. When to use struts technology? What type of applications are developed using struts frame work?
174. What is the need of taglibraries?
175. Explain online banking system using java.that means i need architecture of online banking system.please sir i want full details
176. Text in textarea cant be copy by anyone while it is running in the browser (i.e,the text cant be copy and then paste on the other page) give me suggestion?
177. How can i clear values in sessions. if i open a jsp page it is containing previous values. then i need to open a new page then only i am getting a fresh page
178. What data is stored in the variable appname when we give the folowing statement String appname=(”manager”.equalsIgnoreCAse(request.getContextPath()))?”/manager”:”/portal”;
179. Web browser concept using jsp
180. Why we can’t implement interface in JSP? Why we can only extend classes in JSP?
181. How can we implement logoutpage using jsp ..? and Is there any method to force the browser to show the same page again and again after logout..?
182. How to Upload a textfile from JSP to Servlet
183. My html form contains an INPUT “text” element that accepts Date, i want to catch that date and want to query it using JSP? In short, how can i use that HTML form element with Prepared Statements in JSP?
184. Types of indexing used in oracle applications ? and when and how we decide to implement indexing to database ?
185. What is the need of implicit objects?
186. When we design some login form how we manage security for those forms?which technology used for that purpose?
187. How Do you implement interface in JSP?
188. How can initialize interface in JSP?
189. How do u maintain a Session?
190. What is the differences between JSP LifeCycle and Servlet LifeCycle?
191. Can I call an interface in a JSP?
192. What is the Difference between sendRedirect() and Forward?
193. I want to place two buttons one for save and one for delete.i am using DispatchAction as controller,how can i find which button i am pressing and how to diffrentiate?
194. What is JSP
195. What is the difference betweeen a statis and dynamic include?
196. How can my JSP communicate with java class file
197. I want to accomplish the following scenario: 1) user submits a jpg/gif file from an html form (using in the form, the user can browse to a file of their choice) 2) upload the jpg/gif file through a combination of Java and JSP’s 3) put the jpg/gif into a database on a server and/or into a folder on my local system.
198. How to pop up a jsp page?refreshing every two seconds.
199. What is difference between scriptlet and expression
200. What does < %= obj.getXXX() %> the following expression get evaluated to ?
201. How can we move from one JSP page to another(mean using what tecnique?)

C/C++/JAVA / JSP QUESTIONS

1. Difference between arrays and pointers?
2. What is the purpose of realloc( )?
3. What is static memory allocation and dynamic memory allocation?
4. How are pointer variables initialized?
5. Are pointers integers?
6. What is a pointer variable?
7. What is a pointer value and address?
8. What is a method?
9. What are the advantages of the functions?
10. What is the purpose of main( ) function?
11. What is an argument? differentiate between formal arguments and actual arguments?
12. What is a function and built-in function?
13. What is modular programming?
14. When does the compiler not implicitly generate the address of the first element of an array?
15. What are the characteristics of arrays in C?
16. Differentiate between a linker and linkage?
17. What are advantages and disadvantages of external storage class?
18. Diffenentiate between an internal static and external static variable?
19. What are the advantages of auto variables?
20. What is storage class and what are storage variable?
21. Which expression always return true? Which always return false?
22. Write the equivalent expression for x%8?
23. Why n++ executes faster than n+1?
24. What is a modulus operator? What are the restrictions of a modulus operator?
25. What is the difference between a string and an array?
26. Is it better to use a pointer to navigate an array of values,or is it better to use a subscripted array name?
27. Can the sizeof operator be used to tell the size of an array passed to a function?
28. Is using exit() the same as using return?
29. Is it possible to execute code even after the program exits the main() function?
30. What is a static function?
31. Why should I prototype a function?
32. How do you print an address?
33. Can math operations be performed on a void pointer?
34. How can you determine the size of an allocated portion of memory?
35. What is a “null pointer assignment” error? What are bus errors, memory faults, and core dumps?
36. What is the difference between NULL and NUL?
37. What is the heap?
38. Can the size of an array be declared at runtime?
39. What is the stack?
40. When should a far pointer be used?
41. What is the difference between far and near?
42. Is it better to use malloc() or calloc()?
43. Why should we assign NULL to the elements (pointer) after freeing them?
44. When would you use a pointer to a function?
45. How do you use a pointer to a function?
46. Can you add pointers together? Why would you?
47. What does it mean when a pointer is used in an if statement?
48. Is NULL always defined as 0?
49. What is a void pointer?
50. What is a null pointer?
51. How many levels of pointers can you have?
52. What is indirection?
53. How do you print only part of a string?
54. How can I convert a string to a number?
55. How can I convert a number to a string?
56. What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
57. How can you check to see whether a symbol is defined?
58. How do you override a defined macro?
59. What is #line used for?
60. What is a pragma?
61. What are the standard predefined macros?
62. How can type-insensitive macros be created?
63. How many levels deep can include files be nested?
64. Can include files be nested?
65. Can you define which header file to include at compile time?
66. What is the difference between #include and #include “file”?
67. Is it better to use a macro or a function?
68. How are portions of a program disabled in demo versions?
69. What is the benefit of using an enum rather than a #define constant?
70. What is the benefit of using #define to declare a constant?
71. Can a file other than a .h file be included with #include?
72. How can you avoid including a header more than once?
73. What will the preprocessor do for a program?
74. What is a macro, and how do you use it?
75. What is Preprocessor?
76. How can I make sure that my program is the only one accessing a file?
77. How can I open a file so that other programs can update it at the same time?
78. How do you determine whether to use a stream function or a low-level function?
79. What is the difference between text and binary modes?
80. How can you restore a redirected standard stream?
81. How do you redirect a standard stream?
82. How can I search for data in a linked list?
83. How can I sort a linked list?
84. What is hashing?
85. What is the quickest searching method to use?
86. What is the easiest searching method to use?
87. How can I sort things that are too large to bring into memory?
88. What is the quickest sorting method to use?
89. What is the easiest sorting method to use?
90. What is the benefit of using const for declaring constants?
91. Can static variables be declared in a header file?
92. What is the difference between declaring a variable and defining a variable?
93. Is it acceptable to declare/define a variable in a C header?
94. When should a type cast not be used?
95. When should a type cast be used?
96. How can you determine the maximum value that a numeric variable can hold?
97. How reliable are floating-point comparisons?
98. Can a variable be both const and volatile?
99. When should the volatile modifier be used?
100. When should the register modifier be used? Does it really help?



Top JSP interview questions

Categories: Interviews, Java, JSP

1. Can you make use of a ServletOutputStream object from within a JSP page?
2. Can a JSP page instantiate a serialized bean?
3. Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?
4. What is the page directive is used to prevent a JSP page from automatically creating a session?
5. How do you prevent the Creation of a Session in a JSP Page and why?
6. How do I include static files within a JSP page?
7. How can I implement a thread-safe JSP page?
8. How do I mix JSP and SSI #include?
9. Can a JSP page process HTML FORM data?
10. What JSP lifecycle methods can I override?
11. How do I perform browser redirection from a JSP page?
12. Is there a way to reference the “this” variable within a JSP page?
13. Can I stop JSP execution while in the midst of processing a request?
14. How do I use comments within a JSP page?
15. How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
16. How does JSP handle run-time exceptions?
17. How do I use a scriptlet to initialize a newly instantiated bean?
18. How can I enable session tracking for JSP pages if the browser has disabled cookies?
19. How can I declare methods within my JSP page?
20. How can I set a cookie and delete a cookie from within a JSP page?
21. Is there a way I can set the inactivity lease period on a per-session basis?
22. How does a servlet communicate with a JSP page?
23. How do I have the JSP-generated servlet subclass my own custom servlet class, instead of the default?
24. How do you pass control from one JSP page to another?
25. How do you restrict page errors display in the JSP page?
26. How do you call stored procedures from JSP?
27. How do you connect to the database from JSP?
28. What is Declaration?
29. What is difference between scriptlet and expression?
30. What is jsp:use bean. What are the scope attributes & difference between these attributes?
31. What are the implicit objects in JSP & differences between them?
32. What are Custom tags. Why do you need Custom tags. How do you create Custom tag?
33. What is the difference between include directive & jsp:include action?
34. What are advantages of JSP?
35. What is JSP?
36. Can a single JSP page be considered as a J2EE application?
37. How to call EJB from JSP.
38. What is the architecture of JSP?
39. What is the difference between servlet session and jsp session?
40. Why should we setContentType() in servlet ?what is the use of that method?
41. When jsp is compiled into servlet, where the servlet is actually stored(storage location)?
42. How to generate BAR & PIE Graphs using JSP code…?
43. What is the diff. b/n declaring members in and declaraing in jspinit() method ?
44. How to check the value in the text field is not a number
45. what is the use of extends in jsp…we we want to import a class in current jsp file which i am working how can i do that …if i use extnds for that means how can i do that…pls explain me this
46. I have a String name & Map m, in my bean class. I have get & set methods on both. To Display the String name, i do The above one works fine. Te below one, displays the entire Map contents I know the KEY, how do i display the VALUE for that KEY
47. What is the difference between , pagedirective include, action tag include ?
48. What are the default objects provided by JSP container? Other than page, request, session and context objects.
49. What is the default scope of jsp tags?
50. When many Users are browsing the same application at the same time and they click the “Submit” button will many objects be created for each and every User?
51. What is the difference between Difference between doGet() and doPost()?
52. How do we perform redirect action without using response.sendRedirect(” “);
53. A] Is the response.sendRedirect ends the existing session? B] If I logged in to a site ( say a.com) & then in same browser window I type the url for another site (say b.com), then does my session gets ended on first site ( a. com ) ?
54. How to overwrite the init and destroy method in a jsp page.
55. Where do we use hidden variables and url rewriting? and wat is the difference between them?
56. What is the difference between session and cookie ?
57. How to pass java script array to jsp page?
58. What is the difference betweeen JSP forward and servlet forward methods?
59. Where can we find the compiled file of jsp in the directory struture.
60. How we abort jsp page from a servlet
61. What is difference between getAttribute() and getParameter()?
62. What is the diff. b/w PAGE,APPLICATION and SESSION implicit objects of JSP?
63. Wat is the difference between and in jsp..wen translate into servlet..wer it is stored in servlet..can we create global variables in jsp..if yes then how??
64. How can i restrict the user from Clicking of Back button in any browser
65. In one class i stored the key and values in the hashmap.so using key value i have to check wheter the value for key is correct or not.so how to retreive the key and values in jsp page
66. What is the differnce between application server and web server
67. What is use of implict Objects?why the container is given those one?
68. How to delete cookies in JSP?
69. In Oracle table some fields are “null”.By default it will show as “null” in JSP page text box.But i dont want that. I want as blank textbox.What i can do for that?
70. In Internet explorer if we give a jsp , How the server will know it has to execute?
71. How the jsp changes will be effected in servlet file after converting?
72. When to use struts technology? What type of applications are developed using struts frame work?
73. What is the need of taglibraries?
74. Explain online banking system using java.that means i need architecture of online banking system.please sir i want full details
75. Text in textarea cant be copy by anyone while it is running in the browser (i.e,the text cant be copy and then paste on the other page) give me suggestion?
76. How can i clear values in sessions. if i open a jsp page it is containing previous values. then i need to open a new page then only i am getting a fresh page
77. What data is stored in the variable appname when we give the folowing statement String appname=(”manager”.equalsIgnoreCAse(request.getContextPath()))?”/manager”:”/portal”;
78. Web browser concept using jsp
79. Why we can’t implement interface in JSP? Why we can only extend classes in JSP?
80. How can we implement logoutpage using jsp ..? and Is there any method to force the browser to show the same page again and again after logout..?
81. How to Upload a textfile from JSP to Servlet
82. My html form contains an INPUT “text” element that accepts Date, i want to catch that date and want to query it using JSP? In short, how can i use that HTML form element with Prepared Statements in JSP?
83. Types of indexing used in oracle applications ? and when and how we decide to implement indexing to database ?
84. What is the need of implicit objects?
85. When we design some login form how we manage security for those forms?which technology used for that purpose?
86. How Do you implement interface in JSP?
87. How can initialize interface in JSP?
88. How do u maintain a Session?
89. What is the differences between JSP LifeCycle and Servlet LifeCycle?
90. Can I call an interface in a JSP?
91. What is the Difference between sendRedirect() and Forward?
92. I want to place two buttons one for save and one for delete.i am using DispatchAction as controller,how can i find which button i am pressing and how to diffrentiate?
93. What is JSP
94. What is the difference betweeen a statis and dynamic include?
95. How can my JSP communicate with java class file
96. I want to accomplish the following scenario: 1) user submits a jpg/gif file from an html form (using in the form, the user can browse to a file of their choice) 2) upload the jpg/gif file through a combination of Java and JSP’s 3) put the jpg/gif into a database on a server and/or into a folder on my local system.
97. How to pop up a jsp page?refreshing every two seconds.
98. What is difference between scriptlet and expression
99. What does < %= obj.getXXX() %> the following expression get evaluated to ?
100. How can we move from one JSP page to another(mean using what tecnique?)

C++ interview questions

1. What is virtual constructors/destructors?
2. What is pure virtual functions?
3. What is namespace?
4. What is RTTI?
5. What is a template?
6. What is inline function?
7. What is virtual class and friend class?
8. What is function overloading and operator overloading?
9. Difference between realloc() and free()?
10. What is binding of data and functions?
11. What is abstraction?
12. What is encapsulation?
13. What is the difference between an object and a class?
14. What is polymorphism? Explain with an example?
15. What is inheritance?
16. What is a scope resolution operator?
17. What are virtual functions?
18. What is friend function?
19. What is the difference between class and structure?
20. What is public, protected, private?
21. What is an object?
22. What is a class?
23. What is the difference between Function and Member function?
24. What is a memory leak? How can we avoid it?
25. Define copy constructor? What is the use of copy constructor?
26. How do you write a program which produces its own source code as its output?
27. Can you allocate the memory using malloc() in C and deallocate the same memory using free() in c++
28. it possible to inherit the private member in drived class?
29. What are the things contains in .obj file ? ( compiled result of .cpp file )
30. What is difference between followin intialization. int iVar1; int iVar2 = int(); and which one of two should we prefer always and why?
31. What is the use of volatile keyword? Give me one example?
32. What is the difference between Object and Instance?
33. What is function overriding?
34. Can we take “main function” as of type float,char etc?
35. Hey anybody help me to write code for this program wap which display year,month & day presents in a year for eg. 1. no. is 14 print 2 weeks 2. no is 90 print 3 months 3. no is 365 print 1 year user can input any no
36. How is static variable stored in the memory? ( if there are 2 functions in a file,and the static variable name is same (ex var) in both the function. how is it keep seperately in the memory).
37. What will be output of the following code #include using namespace std; class abc { public : void main() { cout<<" Its main function "< } }; int main(int c, char **v) { abc a; if(c<1) { cout<<" Error can not accept it "< exit(1); } cout<<" its in main program "< a.main(); return 0; }
38. What is the difference betwen wait() and delay()?
39. Why always array starts with index 0
40. Can main() be overridden
41. What is the difference between macro and inline()?
42. How can we define a dynamic memory allocation in UNIX operating system?
43. What are auto static variables and auto extern variables?
44. Different types of languages compare in c++ and other lanuages
45. Oops concepts in other language oops
46. How can double dimensional arrays be dynamically initialized in C++?
47. Can destructor be private?
48. Why Pointers are not used in C Language. What are the main differences between C and C++
49. What is memory leaking in c++ ?
50. class A() { }; int main() { A a; } Whether there will be a default contructor provided by the compiler in above case ?
51. class A() { }; int main() { A a; } Whether there will be a default contructor provided by the compiler in above case ?
52. What is operator overloading?what r the advantages of operator overloading?
53. Why array index starts from 0[zero] only?
54. What is the difference between c&c++?
55. What is the use of virtual destructor?
56. Why cant one make an object of abstract class?Give compiler view of statement
57. What is the need /use of function overloading
58. In c++ have a default constructor ?
59. What is a “RTTI”?
60. Have you heard of “mutable” keyword?
61. What is “strstream”?
62. What are inline functions?
63. Can we generate a C++ source code from the binary file?
64. Explain “passing by value”, “passing by pointer” and “passing by reference”
65. How to write a program such that it will delete itself after execution?
66. Difference between “vector” and “array”?
67. What are the types of STL containers?
68. Difference between a “assignment operator” and a “copy constructor”
69. Can we have “Virtual Constructors”?
70. What are the different types of Storage classes?
71. What are Virtual Functions? How to implement virtual functions in “C”
72. What are the different types of polymorphism?
73. Explain the need for “Virtual Destructor”.
74. What is the difference between “overloading” and “overriding”?
75. Difference between “C structure” and “C++ structure”.
76. What will happen if I say delete this
77. What is the output of printf (”%d”)
78. What is an algorithm (in terms of the STL/C++ standard library)?
79. How can you force instantiation of a template?
80. What is the difference between operator new and the new operator?
81. Can you explain the term “resource acquisition is initialization?”
82. What is defference between constructor and destructor
83. What is encapsulation?
84. What is the difference between an object and a class?
85. What is inheritance?
86. What is a scope resolution operator?
87. What is the Basic nature of “cin” and “cout” and what concept or principle we are using on those two?
88. What are virtual functions?
89. We can overload assignment operator as a normal function.But we can not overload assignment operator as friend function why?
90. What is the difference between class and structure?
91. What is an object?
92. What is the difference between structures and classes in C++?
93. What is a class?
94. What is polymorphism? Explain with an example?
95. What is public, protected, private?
96. What is friend function?
97. What is binding of data and functions?
98. Difference between realloc() and free()?
99. What is function overloading and operator overloading?
100. What is virtual class and friend class?

C# interview questios

1. What is the difference between shadow and override
2. You have an event handler called MyEvent and you want to link the click event of control, MyButton, to use MyEvent, what is the code that will like them together?
3. Which debugging window allows you to see the methods called in the order they were called?
4. Which debugging window allows you to see all the name and values of all the variables in scope?
5. What is wrapper class?is it available in c#?
6. What is protected internal class in C#
7. Which keyword is used of specify a class that cannot inherit by other class
8. Can you create the instance for abstract classes
9. Can we use Friend Classes or functions in Cthe way we use it in C++
10. How we can use inheritance and polymorphisms in cprogramming?
11. How to find exceptions in database
12. How can objects be late bound in .NET?
13. Where we can use DLL made in C#.Net
14. What Datatypes does the RangeValidator Control support?
15. Constructor is the method which is implicitly created when ever a class is instantiated. Why?
16. Why multiple Inheritance is not possible in C#?
17. Why strings are immutable?
18. This is a Regular expression built for parsing string in vb.net and passed to Regex class. Dim are As Regex = New Regex(”,(?=([^”"]*”"[^”"]*”")*(?![^”"]*”"))”) What is Cequivalent for this regular expression.
19. How to convert ocx into DLL
20. What is the main difference between pointer and delegate with examples?
21. What is object pooling
22. How do I read the information from web.config file?
23. What is the default Function arguments?
24. What is XML Schema?
25. How can I check whether a dataset is empty or not in C#.net
26. Is it possible to inherit a class that has only private constructor?
27. How do you choose 1 entry point when Cproject has more Main( ) method?
28. The compiler throws an error if XML comments is not well formed
29. Which of the following is not a Creserved keyword
30. By declaring a base class function as virtual we allow the function to be overridden in subclasses
31. Which of the following can not be declared as virtual
32. Sealed class can be inherited
33. Which of the following statements is not true for interfaces
34. It is not permitted to declare modifier on the members in an interface definition
35. Interface members can not be declared as
36. Which method is implicitly called when an object is created
37. Which of the following statement is invalid with regards to constructor
38. Constructors can not be static
39. It is perfectly legitimate to throw exceptions from catch and finally blocks
40. It is not possible for a delegate to wrap more than 1 methos
41. In Cevents are actually a special form of delegates
42. Which preprocessor directive are used to mark that contain block of code is to be treated as a single block
43. How are the attributes specified in C#
44. For performing repeated modification on string which class is preferred
45. In order to use stringbuilder in our class we need to refer
46. Which of the following is not a member of stringbuilder
47. Which method is actually called ultimately when Console.WriteLine( ) is invoked
48. What happens when you create an arraylist as ArrayList Arr=new ArrayList()
49. What is the output of Vectors.RemoveAt(1)
50. GetEnumerator( ) of Ienumerable interface returns
51. How do you add objects to hashtable
52. If A.equals(B) is true then A.getHashcode & B.getHashCode must always return same hash code
53. The assembly class is defined in
54. What is the first step to do anything with assembly
55. How do you load assembly to running process
56. Assemblies cannot be loaded side by side
57. Application Isolation is assured using
58. Where does the version dependencies recorded
59. How do you refer parent classes in C#
60. Which attribute you generally find on top of main method
61. How do you make a class not instantiable
62. In a multilevel hierarchy how are the constructors are called
63. Which utility is used to create resource file
64. What is the extension of a resource file
65. A shared assembly must have a strong name to uniquely identify the assembly
66. Public policy applies to
67. Stream object can not be initialized
68. Which of the following has stream as the base class
69. Which class use to Read/Write data to memory
70. To Configure .Net for JIT activation what do you do
71. Which method is used by COM+ to ascertain whether class can be pooled
72. How do you import Activex component in to .NET
73. Net Remoting doesn’t allow creating stateless & stateful Remote objects
74. Windows services created by Capp run only
75. The Ckeyword int maps to which .NET type
76. What is an indexer in C#
77. In the following cases which is not function overloading
78. How to implement multiple inheritence in C#
79. In Ca technique used to stream the data is known as
80. Can static methods be overridable?
81. What is the use of fixed statement
82. What is the order of destructors called in a polymorphism hierarchy
83. How can you sort the elements of the array in descending order
84. Is it possible to Override Private Virtual methods
85. What does the volatile modifier do
86. What is the Cequivalent of System.Single
87. A single line comments are implemented by
88. Code running under the control of CLR is often referred as
89. Platform specific code is obtained when
90. Intermediate Language also facilitates language interoperability
91. Which are the important features of IL
92. NET interfaces are not derived from IUnknown & they do not have associated GUID’s
93. Code written in C cannot used in which of the languages
94. It is not possible to debug the classes written in other .Net languages in a Cproject.
95. Which of the following is not a subclass of Value Type class
96. Which of the following is not a subclass of reference type
97. Which is .NET s answer to Memory Management
98. .NET run time relies on the object reference counts to manage memory
99. What are Namespaces
100. Which of the following keyword is used along with Main function in C#

JAVA QUESTIONS

How do I instantiate a bean whose constructor accepts parameters using the useBean tag?

Replacing Characters in a String?

Searching a String?

Connecting to a Database and Strings Handling?

What is a transient variable?

What is the difference between Serializalble and Externalizable interface?

How many methods in the Externalizable interface?

How many methods in the Serializable interface?

How to make a class or a bean serializable?

What is the serialization?

What are synchronized methods and synchronized statements?

What is synchronization and why is it important?

What is the purpose of finalization?

What classes of exceptions may be caught by a catch clause?

What is the difference between the Reader/Writer class hierarchy and the InputStream/ OutputStream class hierarchy?

What happens when a thread cannot acquire a lock on an object?

What restrictions are placed on method overriding?

What restrictions are placed on method overloading?

How does multithreading take place on a computer with a single CPU?

How is it possible for two String objects with identical values not to be equal under the == operator?

How are this() and super() used with constructors?

What class allows you to read objects directly from a stream?

What is the ResourceBundle class?

What interface must an object implement before it can be written to a stream as an object?

What is Serialization and deserialization?

What are the Object and Class classes used for?

Can you write Java code for declaration of multiple inheritance in Java ?

What do you mean by multiple inheritance in C++ ?

Write the Java code to declare any constant (say gravitational constant) and to get its value.

What are the disadvantages of using threads?

JAVA QUESTIONS

JAVA QUESTIONS:

# How do I instantiate a bean whose constructor accepts parameters using the useBean tag?

# Replacing Characters in a String?

# Searching a String?

# Connecting to a Database and Strings Handling?

# What is a transient variable?

# What is the difference between Serializalble and Externalizable interface?

# How many methods in the Externalizable interface?

# How many methods in the Serializable interface?

# How to make a class or a bean serializable?

# What is the serialization?

# What are synchronized methods and synchronized statements?

# What is synchronization and why is it important?

# What is the purpose of finalization?

# What classes of exceptions may be caught by a catch clause?

# What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

# What happens when a thread cannot acquire a lock on an object?

# What restrictions are placed on method overriding?

# What restrictions are placed on method overloading?

# How does multithreading take place on a computer with a single CPU?

# How is it possible for two String objects with identical values not to be equal under the == operator?

# How are this() and super() used with constructors?

# What class allows you to read objects directly from a stream?

# What is the ResourceBundle class?

# What interface must an object implement before it can be written to a stream as an object?

# What is Serialization and deserialization?

# What are the Object and Class classes used for?

# Can you write Java code for declaration of multiple inheritance in Java ?

# What do you mean by multiple inheritance in C++ ?

# Write the Java code to declare any constant (say gravitational constant) and to get its value.

# What are the disadvantages of using threads?

# Given two tables Student(SID, Name, Course) and Level(SID, level) write the SQL statement to get the name and SID of the student who are taking course = 3 and at freshman level.

# What do you mean by virtual methods?

# What do you mean by static methods?

# What do mean by polymorphism, inheritance, encapsulation?

# What are the advantages of OOPL?

# How many methods do u implement if implement the Serializable Interface?

# Are there any other 'marker' interfaces?

# What is the difference between instanceof and isInstance?

# Why do you create interfaces, and when MUST you use one?

# What's the difference between the == operator and the equals() method? What test does Object.equals() use, and why?

# Discuss the differences between creating a new class, extending a class and implementing an interface; and when each would be appropriate.

# Given a text file, input.txt, provide the statement required

# Name four methods every Java class will have.

# What does the "abstract" keyword mean in front of a method? A class?

# Does Java have destructors?

# Are constructors inherited? Can a subclass call the parent's class constructor? When?

# What synchronization constructs does Java provide? How do they work?

# Why "bytecode"? Can you reverse-engineer the code from bytecode?

# Does Java have "goto"?

# What does the "final" keyword mean in front of a variable? A method? A class?

# Access specifiers: "public", "protected", "private", nothing?

# What is JDBC? Describe the steps needed to execute a SQL query using JDBC.

# What is RMI?

# What are native methods? How do you use them?

# What does the keyword "synchronize" mean in java. When do you use it? What are the disadvantages of synchronization?

# How many different types of JDBC drivers are present? Discuss them.

# What is the difference between a Vector and an Array. Discuss the advantages and disadvantages of both?

# Describe java's security model.

# Java says "write once, run anywhere". What are some ways this isn't quite true?

# What is the difference between an Applet and an Application?

# How can you force all derived classes to implement a method present in the base class?

# What are abstract classes, abstract methods?

# What's the difference between == and equals method?

# Describe, in general, how java's garbage collector works?

# What is the difference between StringBuffer and String class?

# How can you achieve Multiple Inheritance in Java?

# What are interfaces?

# What are the main differences between Java and C++?

# In Java, You can create a String object as: String str = "abc"; & String str = new String("abc"); Why cant a button object be created as : Button bt = "abc" Why is it compulsory to create a button object as: Button bt = new Button("abc"); Why is this not compulsory in String's case?

# Why are Java ARchive (JAR) files important?

# What is it reflection (introspection) ? Why is reflection possible in the Java language?

# How to make application thread-safe ?

# What is it object serialization?

# What do you know about networking support in Java?

# What you know about Corba implementation in Java?
#What is Java Beans?

# Compare SWING components to standard AWT.

# What is layout manager ? How does it work?

# What is the purpose of the toolkit in the Abstract Window Toolkit (AWT)? How does AWT work?

# What are the differences between Java & C++ in terms of its features?

# Is the ternary operator written x : y ? z or x ? y : z ?

# What is the List interface?

# What is the difference between an if statement and a switch statement?

# What are the problems faced by Java programmers who don't use layoutmanagers?

# What are the two basic ways in which classes that can be run as threads may be defined?

# What are synchronized methods and synchronized statements?

# Which Component subclass is used for drawing and painting?

# What methods are used to get and set the text label displayed by a Buttonobject?

# What method must be implemented by all threads?

# When is an object subject to garbage collection?

# Can an unreachable object become reachable again?

# How does a try statement determine which catch clause should be used tohandle an exception?

# What are the Object and Class classes used for?

# What modifiers may be used with a top-level class?

# What is a Java package and how is it used?

# What is the purpose of a statement block?

# What is the difference between the prefix and postfix forms of the ++ operator?

# Can try statements be nested?

# To what value is a variable of the boolean type automatically initialized?

# What is the difference between a public and a non-public class?

C/C++ Questions

# What is virtual constructors/ destructors?

# What do you mean by pure virtual functions?

# What is namespace?

# What is RTTI?

# What is a template?

# What do you mean by inline function?

# What is virtual class and friend class?

# What is function overloading and operator overloading?

# Difference between realloc() and free()?

# What do you mean by binding of data and functions?

# What is abstraction?

# What is encapsulation?

# What is the difference between an object and a class?

# What is polymorphism? Explain with an example?

# What do you mean by inheritance?

# What is a scope resolution operator?

# What are virtual functions?

# What is friend function?

# What is the difference between class and structure?

# What is public, protected, private?

# What is an object?

# What is a class?

# What is the difference between Function and Member function?

# What is a memory leak? How can we avoid it?

# Define copy constructor? What is the use of copy constructor?

# How do you write a program which produces its own source code as its output?

#Can you allocate the memory using malloc() in C and deallocate the same memory using free() in c++

# it possible to inherit the private member in drived class?

# What are the things contains in .obj file ? ( compiled result of .cpp file )

# What is difference between followin intialization. int iVar1; int iVar2 = int(); and which one of two should we prefer always and why?

# what is the use of volatile keyword? Give me one example?

# What is the difference between Object and Instance?

# What is function overriding?

# Can we take "main function" as of type float,char etc?

# Hey anybody help me to write code for this program wap which display year,month & day presents in a year for eg. 1. no. is 14 print 2 weeks 2. no is 90 print 3 months 3. no is 365 print 1 year user can input any no

# How is static variable stored in the memory? ( if there are 2 functions in a file,and the static variable name is same (ex var) in both the function. how is it keep seperately in the memory).

# What will be output of the following code #include using namespace std; class abc { public : void main() { cout<<" Its main function "< } }; int main(int c, char **v) { abc a; if(c<1) { cout<<" Error can not accept it "< exit(1); } cout<<" its in main program "< a.main(); return 0; }

# what is the difference betwen wait() and delay()?

# Why always array starts with index 0

# Can main() be overridden

# What is the difference between macro and inline()?

# How can we define a dynamic memory allocation in UNIX operating system?

# what are auto static variables and auto extern variables?

# 1.Different types of languages compare in c++ and other lanuages 2.Oops concepts in other language oops

# 1.Different types of languages compare in c++ and other lanuages 2.Oops concepts in other language oops

# How can double dimensional arrays be dynamically initialized in C++?

# Can destructor be private?

# Why Pointers are not used in C Language. What are the main differences between C and C++

# what is memory leaking in c++ ?

# class A() { }; int main() { A a; } Whether there will be a default contructor provided by the compiler in above case ?

# class A() { }; int main() { A a; } Whether there will be a default contructor provided by the compiler in above case ?

# What is operator overloading? what r the advantages of operator overloading?

# why array index starts from 0[zero] only?

# what is the difference between c&c++?

# what is the use of virtual destructor?

# Why cant one make an object of abstract class?Give compiler view of statement

# What is the need /use of function overloading

# In c++ have a default constructor ?

# What is a "RTTI"?

# Have you heard of "mutable" keyword?

# What is "strstream”?

# What are inline functions?

# Can we generate a C++ source code from the binary file?

# Explain "passing by value", "passing by pointer" and "passing by reference"

#How to write a program such that it will delete itself after execution?

# Difference between "vector" and "array"?

# What are the types of STL containers?

# Difference between a "assignment operator" and a "copy constructor"

# Can we have "Virtual Constructors" ?

# What are the different types of Storage classes?

# What are Virtual Functions? How to implement virtual functions in "C"

# What are the different types of polymorphism?

# Explain the need for "Virtual Destructor".

# What is the difference between "overloading" and "overriding" ?

# Difference between "C structure" and "C++ structure".

# What will happen if I say delete this

# What is the output of printf ("%d")

# What is an algorithm (in terms of the STL/C++ standard library)?

# How can you force instantiation of a template?

# What is the difference between operator new and the new operator?

# Can you explain the term "resource acquisition is initialization? "

# what is defference between constructor and destructor

# What is encapsulation?

# What is the difference between an object and a class?

# What do you mean by inheritance?

# What is a scope resolution operator?

# What is the Basic nature of "cin" and "cout" and what concept or principle we are using on those two?

# What are virtual functions?

# We can overload assignment operator as a normal function.But we can not overload assignment operator as friend function why?

# What is the difference between class and structure?

# What is an object?

# What is the difference between structures and classes in C++?

# What is a class?

# What is polymorphism? Explain with an example?

# What is public, protected, private?

# What is friend function?

# What do you mean by binding of data and functions?

# Difference between realloc() and free()?

# What is function overloading and operator overloading?

# What is virtual class and friend class?

What is the difference between an ARRAY and a LIST?

What is faster : access the element in an ARRAY or in a LIST?

Define a constructor - what it is and how it might be called (2 methods).

Describe PRIVATE, PROTECTED and PUBLIC – the differences and give examples.

What is a COPY CONSTRUCTOR and when is it called (this is a frequent question !)?

Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how
would I define DRAW methods for two objects CIRCLE and SQUARE.

What is the word you will use when defining a function in base class to allow this function to be a polimorphic
function?

What are 2 ways of exporting a function from a DLL?

You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg.
new() and malloc()

What is a callback function. Explain in C and C++ and WIN API environment.
(From WINDOWS API area): what is LPARAM and WPARAM?

C++ QUESTIONS

1. What is virtual constructors/destructors?
2. What is pure virtual functions?
3. What is namespace?
4. What is RTTI?
5. What is a template?
6. What is inline function?
7. What is virtual class and friend class?
8. What is function overloading and operator overloading?
9. Difference between realloc() and free()?
10. What is binding of data and functions?
11. What is abstraction?
12. What is encapsulation?
13. What is the difference between an object and a class?
14. What is polymorphism? Explain with an example?
15. What is inheritance?
16. What is a scope resolution operator?
17. What are virtual functions?
18. What is friend function?
19. What is the difference between class and structure?
20. What is public, protected, private?
21. What is an object?
22. What is a class?
23. What is the difference between Function and Member function?
24. What is a memory leak? How can we avoid it?
25. Define copy constructor? What is the use of copy constructor?
26. How do you write a program which produces its own source code as its output?
27. Can you allocate the memory using malloc() in C and deallocate the same memory using free() in c++
28. it possible to inherit the private member in drived class?
29. What are the things contains in .obj file ? ( compiled result of .cpp file )
30. What is difference between followin intialization. int iVar1; int iVar2 = int(); and which one of two should we prefer always and why?
31. What is the use of volatile keyword? Give me one example?
32. What is the difference between Object and Instance?
33. What is function overriding?
34. Can we take “main function” as of type float,char etc?
35. Hey anybody help me to write code for this program wap which display year,month & day presents in a year for eg. 1. no. is 14 print 2 weeks 2. no is 90 print 3 months 3. no is 365 print 1 year user can input any no
36. How is static variable stored in the memory? ( if there are 2 functions in a file,and the static variable name is same (ex var) in both the function. how is it keep seperately in the memory).
37. What will be output of the following code #include using namespace std; class abc { public : void main() { cout<<" Its main function "< } }; int main(int c, char **v) { abc a; if(c<1) { cout<<" Error can not accept it "< exit(1); } cout<<" its in main program "< a.main(); return 0; }
38. What is the difference betwen wait() and delay()?
39. Why always array starts with index 0
40. Can main() be overridden
41. What is the difference between macro and inline()?
42. How can we define a dynamic memory allocation in UNIX operating system?
43. What are auto static variables and auto extern variables?
44. Different types of languages compare in c++ and other lanuages
45. Oops concepts in other language oops
46. How can double dimensional arrays be dynamically initialized in C++?
47. Can destructor be private?
48. Why Pointers are not used in C Language. What are the main differences between C and C++
49. What is memory leaking in c++ ?
50. class A() { }; int main() { A a; } Whether there will be a default contructor provided by the compiler in above case ?
51. class A() { }; int main() { A a; } Whether there will be a default contructor provided by the compiler in above case ?
52. What is operator overloading?what r the advantages of operator overloading?
53. Why array index starts from 0[zero] only?
54. What is the difference between c&c++?
55. What is the use of virtual destructor?
56. Why cant one make an object of abstract class?Give compiler view of statement
57. What is the need /use of function overloading
58. In c++ have a default constructor ?
59. What is a “RTTI”?
60. Have you heard of “mutable” keyword?
61. What is “strstream”?
62. What are inline functions?
63. Can we generate a C++ source code from the binary file?
64. Explain “passing by value”, “passing by pointer” and “passing by reference”
65. How to write a program such that it will delete itself after execution?
66. Difference between “vector” and “array”?
67. What are the types of STL containers?
68. Difference between a “assignment operator” and a “copy constructor”
69. Can we have “Virtual Constructors”?
70. What are the different types of Storage classes?
71. What are Virtual Functions? How to implement virtual functions in “C”
72. What are the different types of polymorphism?
73. Explain the need for “Virtual Destructor”.
74. What is the difference between “overloading” and “overriding”?
75. Difference between “C structure” and “C++ structure”.
76. What will happen if I say delete this
77. What is the output of printf (”%d”)
78. What is an algorithm (in terms of the STL/C++ standard library)?
79. How can you force instantiation of a template?
80. What is the difference between operator new and the new operator?
81. Can you explain the term “resource acquisition is initialization?”
82. What is defference between constructor and destructor
83. What is encapsulation?
84. What is the difference between an object and a class?
85. What is inheritance?
86. What is a scope resolution operator?
87. What is the Basic nature of “cin” and “cout” and what concept or principle we are using on those two?
88. What are virtual functions?
89. We can overload assignment operator as a normal function.But we can not overload assignment operator as friend function why?
90. What is the difference between class and structure?
91. What is an object?
92. What is the difference between structures and classes in C++?
93. What is a class?
94. What is polymorphism? Explain with an example?
95. What is public, protected, private?
96. What is friend function?
97. What is binding of data and functions?
98. Difference between realloc() and free()?
99. What is function overloading and operator overloading?
100. What is virtual class and friend class?

APPTITUDE QUESTIONS

# The average age of 10 members of a committee is the same as it was 4 years ago, because an old member has been replaced by a young member. Find how much younger is the new member ?

# Mr. Shah decided to walk down the escalator of a tube station. He found that if he walks down 26 steps, he requires 30 seconds to reach the bottom. However, if he steps down 34 stairs he would only require 18 seconds to get to the bottom. If the time is measured fromthe moment the top step begins to descend to the time he steps off the last step at the bottom, find out the height of the stair way in steps?

# A boat travels 20 kms upstream in 6 hrs and 18 kms downstream in 4 hrs.Find the speed of the boat in still water and the speed of the water current?

# Pipe A can fill in 20 minutes and Pipe B in 30 mins and Pipe C can empty the same in 40mins. If all of them work together, find the time taken to fill the tank

# If x=y=2z and xyz=256 then what is the value of x?

# What is the angle between the two hands of a clock when time is 8:30

# If there are 1024*1280 pixels on a screen and each pixel can have around 16 million colors. Find the memory required for this?

# A boy has Rs 2. He wins or loses Re 1 at a time If he wins he gets Re 1 and if he loses the game he loses Re 1. He can loose only 5 times. He is out of the game if he earns Rs 5. Find the number of ways in which this is possible?

# How many 1's are there in the binary form of 8*1024 + 3*64 + 3

# A man leaves office daily at 7pm A driver with car comes from his home to pick him from office and bring back homeOne day he gets free at 5:30 and instead of waiting for driver he starts walking towards home. In the way he meets the car and returns home on car He reaches home 20 minutes earlier than usual.In how much time does the man reach home usually??

# In objective test a correct ans score 4 marks and on a wrong ans 2 marks are subtracted, a student score 480 marks from 150 question. how many ans were correct?

# 5 men or 8 women do equal amount of work in a day. a job requires 3 men and 5 women to finish the job in 10 days how many woman are required to finish the job in 14 days.

# If an item costs Rs.3 in '99 and Rs.203 in '00.What is the % increase in price?

# A cylinder is 6 cms in diameter and 6 cms in height. If spheres of the same size are made from the material obtained, what is the diameter of each sphere?

# Two trains move in the same direction at 50 kmph and 32 kmph respectively. A man in the slower train observes the 15 seconds elapse before the faster train completely passes by him. What is the length of faster train ?

# If a sum of money compound annually amounts of thrice itself in 3 years. In how many years will it become 9 times itself

# A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there originally?

# If on an item a company gives 25% discount, they earn 25% profit. If they now give 10% discount then what is the profit percentage.

# There are two circles, one circle is inscribed and another circle is circumscribed over a square. What is the ratio of area of inner to outer circle?

# City A's population is 68000, decreasing at a rate of 80 people per year. City B having population 42000 is increasing at a rate of 120 people per year. In how many years both the cities will have same population?

# 20% of a 6 litre solution and 60% of 4 litre solution are mixed. What percentage of the mixture of solution

# Perimeter of the back wheel = 9 feet, front wheel = 7 feet on a certain distance, the front wheel gets 10 revolutions more than the back wheel. What is the distance?

# Each side of a rectangle is increased by 100% .By what percentage does the areaincrease?

# An equilateral triangle of sides 3 inch each is given. How many equilateral triangles of side 1 inch can be formed from it?

# A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay?

# If the total distance of a journey is 120 km .If one goes by 60 kmph and comes back at 40kmph what is the average speed during the journey?

# A worker is paid Rs.20/- for a full days work. He works 1,1/3,2/3,1/ 8.3/4 days in a week. What is the total amount paid for that worker ?

# To 15 lts of water containing 20% alcohol, we add 5 lts of pure water. What is % alcohol.

# The cost of an item is Rs 12.60. If the profit is 10% over selling price what is the selling price ?

# If PQRST is a parallelogram what it the ratio of triangle PQS & parallelogram PQRST

# There are two candles of equal lengths and of different thickness. The thicker one lasts of six hours. The thinner 2 hours less than the thicker one. Ramesh lights the two candles at the same time. When he went to bed he saw the thicker one is twice the length of the thinner one. How long ago did Ramesh light the two candles

# There is a square of side 6cm . A circle is inscribed inside the square. Find the ratio of the area of circle to square.

# The price of a product is reduced by 30% . By what percentage should it be increased to make it 100%

# 1/3 of girls , 1/2 of boys go to canteen .What factor and total number of classmates go to canteen.

# What is the selling price of a car? If the cost of the car is Rs.60 and a profit of 10% over selling price is earned

# Of Abdul, Binoy, and Chandini:a)Each member belongs to the Tee family whose members always tell the truth or to the El family whose members always lie.b)Abdul says ''Either I belong or Binoy belongs to a different family from the other two."Whose family do you name of?

# Three piles of chips--pile I consists one chip, pile II consists of chips, and pile III consists of three chips--are to be used in game played by Anita and Brinda.The game requires:a)That each player in turn take only one chip or all chips from just one pile.b)That the player who has to take the last chip loses.c)That Anita now have her turn.From which pile should Anita draw in order to win?

# Mr. and Mrs. Aye and Mr. and Mrs. Bee competed in a chess tournament.Of the three games played:a)In only the first game werethe two players married to each other.b)The men won two games and the women won one game.c)The Ayes won more games than the Bees.d)Anyone who lost game did not play the subsequent game.Who did not lose a game?

# One of Mr. Horton,his wife,their son,and Mr. Horton's mother is a doctor and another is a lawyer.a)If the doctor is younger than the lawyer, then the doctor and the lawyer are not blood relatives.b) If the doctor is a woman, then the doctor and the lawyer are blood relatives.c) If the lawyer is a man, then the doctor is a man.Whose occupation you know?

# One of Mr. Horton,his wife,their son,and Mr. Horton's mother is a doctor and another is a lawyer.a)If the doctor is younger than the lawyer, then the doctor and the lawyer are not blood relatives.b) If the doctor is a woman, then the doctor and the lawyer are blood relatives.c) If the lawyer is a man, then the doctor is a man.Whose occupation you know?

# I drove 60 km at 30 kmph and then an additional 60 km at 50 kmph. Compute my average speed over my 120 km

# Divide 45 into four parts such that when 2 is added to the first part, 2 is subtracted from the second part, 2 is multiplied by the third part and the fourth part is divided by two, all result in the same number.

# How big will an angle of one and a half degree look through a glass that magnifies things three times?

# If time at this moment is 9 P.M., what will be the time 23999999992 hours later?

# Diophantus passed one sixth of his life in childhood, one twelfth in youth, and one seventh more as a bachelor; five years after his marriage a son was born who died four years before his father at half his final age. How old is Diophantus?

# With just six weights and a balance scale, you can weigh any unit number of kgs from 1 to 364. What could be the six weights?

# A cylindrical container has a radius of eight inches with a height of three inches. Compute how many inches should be added to either the radius or height to give the same increase involume?

# If s(a) denotes square root of a, find the value of s(12+s(12+s( 12+ ...... upto infinity.

# What is the sum of all numbers between 100 and 1000 which are divisible by 14 ?

# Three pipes, A, B, & C are attached to a tank. A & B can fill it in 20 & 30 minutesrespectively while C can empty it in 15 minutes. If A, B & C are kept open successively for 1 minute each, how soon will the tank be filled?

# A garrison of 3300 men has provisions for 32 days, when given at a rate of 850 grams per head. At the end of 7 days a reinforcement arrives and it was found that now the provisions will last 8 days less, when given at the rate of 825 grams per head. How, many more men can it feed?

# Solve for x and y: 1/x - 1/y = 1/3, 1/x2 + 1/y2 = 5/9.

# The minute hand of a clock overtakes the hour hand at intervals of 64 minutes of correct time. How much a day does the clock gain or lose?

# A man ate 100 bananas in five days, each day eating 6 more than the previous day. How many bananas did he eat on the first day?

# A wizard named Nepo says "I am only three times my son's age. My father is 40 years more than twice my age. Together the three of us are a mere 1240 years old." How old is Nepo?

# A certain type of mixture is prepared by mixing brand A at Rs.9 a kg. with brand B at Rs.4 a kg. If the mixture is worth Rs.7 a kg., how many kgs. of brand A are needed to make 40kgs. of the mixture?

# What is the missing number in this series? 8 2 14 6 11 ? 14 6 18 12

# Can you tender a one rupee note in such a manner that there shall be total 50 coins but none of them would be 2 paise coins.?

# The square of a two digit number is divided by half the number. After 36 is added to the quotient, this sum is then divided by 2. The digits of the resulting number are the same as those in the original number, but they are in reverse order. The ten's place of the originalnumber is equal to twice the difference between its digits. What is the number?

# A rectangular plate with length 8 inches, breadth 11 inches and thickness 2 inches is available. What is the length of the circular rod with diameter 8 inches and equal to the volume of the rectangular plate?

# Out of 80 coins, one is counterfeit. What is the minimum number of weighings needed to find out the counterfeit coin?

# Gavaskar's average in his first 50 innings was 50. After the 51st innings, his average was 51. How many runs did he score in his 51st innings. (supposing that he lost his wicket in his 51st innings)

# A fast typist can type some matter in 2 hours and a slow typist can type the same in 3 hours. If both type combinely, in how much time will they finish?

# What is the number of zeros at the end of the product of the numbers from 1 to 100?

# For the following, find the next term in the series1. 6, 24, 60,120, 210

# A man bought a horse and a cart. If he sold the horse at 10 % loss and the cart at 20 % gain, he would not lose anything; but if he sold the horse at 5% loss and the cart at 5% gain, he would lose Rs. 10 in the bargain. The amount paid by him was Rs.- _______ for the horse and Rs.________ for the cart.

# There are 3 persons Sudhir, Arvind, and Gauri. Sudhir lent cars to Arvind and Gauri as many as they had already. After some time Arvind gave as many cars to Sudhir and Gauri as many as they have. After sometime Gauri did the same thing. At the end of this transaction each one of them had 24. Find the cars each originally had.

# The number that does not have a reciprocal is ____________ .

# Which of the following is larger than 3/5? (1) ½ (2) 39/50 (3) 7/25 (4) 3/10 (5) 59/100

# The length of the side of a square is represented by x+2. The length of the side of an equilateral triangle is 2x. If the square and the equilateral triangle have equal perimeter, then the value of x is _______.

# If every alternative letter starting from B of the English alphabet is written in small letter, rest all are written in capital letters, how the month "September" be written. (1) SeptEMbEr (2) SEpTeMBEr (3) SeptembeR (4) SepteMber (5) None of the above.

# Which of the following statements drawn from the given statements are correct? Given: All watches sold in that shop are of high standard. Some of the HMT watches are sold in that shop. a) All watches of high standard were manufactured by HMT. b) Some of the HMT watches are of high standard. c) None of the HMT watches is of high standard. d) Some of the HMT watches of high standard are sold in that shop.

# All men are vertebrates. Some mammals are vertebrates. Which of the following conclusions drawn from the above statement is correct. 1. All men are mammals 2. All mammals are men 3. Some vertebrates are mammals. 4. None

# If point P is on line segment AB, then which of the following is always true? (1) AP = PB (2) AP > PB (3) PB > AP (4) AB > AP (5) AB > AP + PB

# If a light flashes every 6 seconds, how many times will it flash in ¾ of an hour?

# Five boys were climbing a hill. J was following H. R was just ahead of G. K was between G & H. They were climbing up in a column. Who was the second?

# Five farmers have 7, 9, 11, 13 & 14 apple trees, respectively in their orchards. Last year, each of them discovered that every tree in their own orchard bore exactly the same number of apples. Further, if the third farmer gives one apple to the first, and the fifth gives three to each of the second and the fourth, they would all have exactly the same number of apples. What were the yields per tree in the orchards of the third and fourth farmers?

# A tennis marker is trying to put together a team of four players for a tennis tournament out of seven available. males - a, b and c; females - m, n, o and p. All players are of equal ability and there must be at least two males in the team. For a team of four, all players must be able to play with each other under the following restrictions: b should not play with m, c should not play with p, and a should not play with o. Which of the following statements must be false? 1. b and p cannot be selected together 2. c and o cannot be selected together 3. c and n cannot be selected together.

# A man bought a horse and a cart. If he sold the horse at 10 % loss and the cart at 20 % gain, he would not lose anything; but if he sold the horse at 5% loss and the cart at 5% gain, he would lose Rs. 10 in the bargain. The amount paid by him was Rs.- _______ for the horse and Rs.________ for the cart.

# what is a percent of b divided by b percent of a?

# A contractor agreeing to finish a work in 150 days, employed 75 men each working 8 hours daily. After 90 days, only 2/7 of the work was completed. Increasing the number of men by ________ each working now for 10 hours daily, the work can be completed in time.

# A man was engaged on a job for 30 days on the condition that he would get a wage of Rs. 10 for the day he works, but he have to pay a fine of Rs. 2 for each day of his absence. If he gets Rs. 216 at the end, he was absent for work for ... days.

# A software engineer has the capability of thinking 100 lines of code in five minutes and can type 100 lines of code in 10 minutes. He takes a break for five minutes after every ten minutes. How many lines of codes will he complete typing after an hour?

# A dishonest shopkeeper professes to sell pulses at the cost price, but he uses a false weight of 950gm. for a kg. His gain is____%.

# A student divided a number by 2/3 when he required to multiply by 3/2. Calculate the percentage of error in his result.

# It was calculated that 75 men could complete a piece of work in 20 days. When work was scheduled to commence, it was found necessary to send 25 men to another project. How much longer will it take to complete the work?

LINUX INTERVIEW QUESTIONS

1. You attempt to use shadow passwords but are unsuccessful. What characteristic of the /etc/passwd file may cause this? Choose one: a. The login command is missing. b. The username is too long. c. The password field is blank. d. The password field is prefaced by an asterick.
2. You create a new user account by adding the following line to your /etc/passwd file. bobm:baddog:501:501:Bob Morris:/home/bobm:/bin/bash Bob calls you and tells you that he cannot logon. You verify that he is using the correct username and password. What is the problem? Choose one: a. The UID and GID cannot be identical. b. You cannot have spaces in the line unless they are surrounded with double quotes. c. You cannot directly enter the password; rather you have to use the passwd command to assign a password to the user. d. The username is too short, it must be at least six characters long.
3. Which of the following tasks is not necessary when creating a new user by editing the /etc/passwd file? Choose one: a. Create a link from the user's home directory to the shell the user will use. b. Create the user's home directory c. Use the passwd command to assign a password to the account. d. Add the user to the specified group.
4. You create a new user by adding the following line to the /etc/passwd file bobm::501:501:Bob Morris:/home/bobm:/bin/bash You then create the user's home directory and use the passwd command to set his password. However, the user calls you and says that he cannot log on. What is the problem? Choose one: a. The user did not change his password. b. bobm does not have permission to /home/bobm. c. The user did not type his username in all caps. d. You cannot leave the password field blank when creating a new user.
5. When using useradd to create a new user account, which of the following tasks is not done automatically. Choose one: a. Assign a UID. b. Assign a default shell. c. Create the user's home directory. d. Define the user's home directory.
6. You issue the following command useradd -m bobm But the user cannot logon. What is the problem? Choose one: a. You need to assign a password to bobm's account using the passwd command. b. You need to create bobm's home directory and set the appropriate permissions. c. You need to edit the /etc/passwd file and assign a shell for bobm's account. d. The username must be at least five characters long.
7. You have created special configuration files that you want copied to each user's home directories when creating new user accounts. You copy the files to /etc/skel. Which of the following commands will make this happen? Choose one: a. useradd -m username b. useradd -mk username c. useradd -k username d. useradd -Dk username
8. Mary has recently gotten married and wants to change her username from mstone to mknight. Which of the following commands should you run to accomplish this? Choose one: a. usermod -l mknight mstone b. usermod -l mstone mknight c. usermod -u mknight mstone d. usermod -u mstone mknight
9. After bob leaves the company you issue the command userdel bob. Although his entry in the /etc/passwd file has been deleted, his home directory is still there. What command could you have used to make sure that his home directory was also deleted? Choose one: a. userdel -m bob b. userdel -u bob c. userdel -l bob d. userdel -r bob
10. All groups are defined in the /etc/group file. Each entry contains four fields in the following order. Choose one: a. groupname, password, GID, member list b. GID, groupname, password, member list c. groupname, GID, password, member list d. GID, member list, groupname, password
11. You need to create a new group called sales with Bob, Mary and Joe as members. Which of the following would accomplish this? Choose one: a. Add the following line to the /etc/group file: sales:44:bob,mary,joe b. Issue the command groupadd sales. c. Issue the command groupadd -a sales bob,mary,joe d. Add the following line to the /etc/group file: sales::44:bob,mary,joe
12. What command is used to remove the password assigned to a group?
13. You changed the GID of the sales group by editing the /etc/group file. All of the members can change to the group without any problem except for Joe. He cannot even login to the system. What is the problem? Choose one: a. Joe forgot the password for the group. b. You need to add Joe to the group again. c. Joe had the original GID specified as his default group in the /etc/passwd file. d. You need to delete Joe's account and recreate it.
14. You need to delete the group dataproject. Which two of the following tasks should you do first before deleting the group? A. Check the /etc/passwd file to make sure no one has this group as his default group. B. Change the members of the dataproject group to another group besides users. C. Make sure that the members listed in the /etc/group file are given new login names. D. Verify that no file or directory has this group listed as its owner. Choose one: a. A and C b. A and D c. B and C d. B and D
15. When you look at the /etc/group file you see the group kmem listed. Since it does not own any files and no one is using it as a default group, can you delete this group?
16. When looking at the /etc/passwd file, you notice that all the password fields contain 'x'. What does this mean? Choose one: a. That the password is encrypted. b. That you are using shadow passwords. c. That all passwords are blank. d. That all passwords have expired.
17. In order to improve your system's security you decide to implement shadow passwords. What command should you use?
18. What file contains the default environment variables when using the bash shell? Choose one: a. ~/.profile b. /bash c. /etc/profile d. ~/bash
19. You have created a subdirectory of your home directory containing your scripts. Since you use the bash shell, what file would you edit to put this directory on your path? Choose one: a. ~/.profile b. /etc/profile c. /etc/bash d. ~/.bash
20. Which of the following interprets your actions when typing at the command line for the operating system? Choose One a. Utility b. Application c. Shell d. Command
21. What can you type at a command line to determine which shell you are using?
22. You want to enter a series of commands from the command-line. What would be the quickest way to do this? Choose One a. Press enter after entering each command and its arguments b. Put them in a script and execute the script c. Separate each command with a semi-colon (;) and press enter after the last command d. Separate each command with a / and press enter after the last command
23. You are entering a long, complex command line and you reach the right side of your screen before you have finished typing. You want to finish typing the necessary commands but have the display wrap around to the left. Which of the following key combinations would achieve this? Choose One a. Esc, /, Enter b. /, Enter c. ctrl-d, enter d. esc, /, ctrl-d
24. After typing in a new command and pressing enter, you receive an error message indicating incorrect syntax. This error message originated from.. Choose one a. The shell b. The operating system c. The command d. The kernel
25. When typing at the command line, the default editor is the _____________ library.
26. You typed the following at the command line ls -al /home/ hadden. What key strokes would you enter to remove the space between the '/' and 'hadden' without having to retype the entire line? Choose one a. Ctrl-B, Del b. Esc-b, Del c. Esc-Del, Del d. Ctrl-b, Del
27. You would like to temporarily change your command line editor to be vi. What command should you type to change it?
28. After experimenting with vi as your command line editor, you decide that you want to have vi your default editor every time you log in. What would be the appropriate way to do this? Choose one a. Change the /etc/inputrc file b. Change the /etc/profile file c. Change the ~/.inputrc file d. Change the ~/.profile file
29. You have to type your name and title frequently throughout the day and would like to decrease the number of key strokes you use to type this. Which one of your configuration files would you edit to bind this information to one of the function keys?
30. In your present working directory, you have the files maryletter memo1 MyTelephoneandAddressBook What is the fewest number of keys you can type to open the file MyTelephoneandAddressBook with vi? Choose one a. 6 b. 28 c. 25 d. 4
31. A variable that you can name and assign a value to is called a _____________ variable.
32. You have installed a new application but when you type in the command to start it you get the error message Command not found. What do you need to do to fix this problem? Choose one a. Add the directory containing the application to your path b. Specify the directory's name whenever you run the application c. Verify that the execute permission has been applied to the command. d. Give everyone read, write and execute permission to the application's directory.
33. You telnet into several of your servers simultaneously. During the day, you sometimes get confused as to which telnet session is connected to which server. Which of the following commands in your .profile file would make it obvious to which server you are attached? Choose one a. PS1='\h: \w>' b. PS1='\s: \W>' c. PS1='\!: \t>' d. PS1='\a: \n>'
34. Which of the following environment variables determines your working directory at the completion of a successful login? Choose one a. HOME b. BASH_ENV c. PWD d. BLENDERDIR
35. Every time you attempt to delete a file using the rm utility, the operating system prompts you for confirmation. You know that this is not the customary behavior for the rm command. What is wrong? Choose one a. rm has been aliased as rm -i b. The version of rm installed on your system is incorrect. c. This is the normal behavior of the newest version of rm. d. There is an incorrect link on your system.
36. You are running out of space in your home directory. While looking for files to delete or compress you find a large file called .bash_history and delete it. A few days later, it is back and as large as before. What do you need to do to ensure that its size is smaller? Choose one a. Set the HISTFILESIZE variable to a smaller number. b. Set the HISTSIZE to a smaller number. c. Set the NOHISTFILE variable to true. d. Set the HISTAPPEND variable to true.
37. In order to display the last five commands you have entered using the history command, you would type ___________.
38. In order to display the last five commands you have entered using the fc command, you would type ___________.
39. You previously ran the find command to locate a particular file. You want to run that command again. What would be the quickest way to do this? Choose one a. fc -l find fc n b. history -l find history n c. Retype the command d. fc -n find
40. Using command substitution, how would you display the value of the present working directory? Choose one a. echo $(pwd) b. echo pwd c. $pwd d. pwd | echo
41. You need to search the entire directory structure to locate a specific file. How could you do this and still be able to run other commands while the find command is still searching for your file? Choose one a. find / -name filename & b. find / -name filename c. bg find / -name filename d. &find / -name filename &
42. In order to create a file called DirContents containing the contents of the /etc directory you would type ____________.
43. What would be displayed as the result of issuing the command ps ef? Choose one a. A listing of the user's running processes formatted as a tree. b. A listing of the stopped processes c. A listing of all the running processes formatted as a tree. d. A listing of all system processes formatted as a tree.
44. What utility can you use to show a dynamic listing of running processes? __________
45. The top utility can be used to change the priority of a running process? Another utility that can also be used to change priority is ___________?
46. What key combination can you press to suspend a running job and place it in the background?
47. You issue the command jobs and receive the following output: [1]- Stopped (tty output) pine [2]+ Stopped (tty output) MyScript How would you bring the MyScript process to the foreground? Choose one: a. fg %2 b. ctrl-c c. fg MyScript d. ctrl-z
48. You enter the command cat MyFile | sort > DirList & and the operating system displays [4] 3499 What does this mean? Choose one a. This is job number 4 and the PID of the sort command is 3499. b. This is job number 4 and the PID of the job is 3499. c. This is job number 3499 and the PID of the cat command is 4. d. This is job number 4 and the PID of the cat command is 3499.
49. You attempt to log out but receive an error message that you cannot. When you issue the jobs command, you see a process that is running in the background. How can you fix this so that you can logout? Choose one a. Issue the kill command with the PID of each running command of the pipeline as an argument. b. Issue the kill command with the job number as an argument. c. Issue the kill command with the PID of the last command as an argument. d. Issue the kill command without any arguments.
50. You have been given the job of administering a new server. It houses a database used by the sales people. This information is changed frequently and is not duplicated anywhere else. What should you do to ensure that this information is not lost? Choose one a. Create a backup strategy that includes backing up this information at least daily. b. Prepare a proposal to purchase a backup server c. Recommend that the server be made part of a cluster. d. Install an additional hard drive in the server.
51. When planning your backup strategy you need to consider how often you will perform a backup, how much time the backup takes and what media you will use. What other factor must you consider when planning your backup strategy? _________
52. Many factors are taken into account when planning a backup strategy. The one most important one is how often does the file ____________.
53. Which one of the following factors does not play a role in choosing the type of backup media to use? Choose one: a. How frequently a file changes b. How long you need to retain the backup c. How much data needs to be backed up d. How frequently the backed up data needs to be accessed
54. When you only back up one partition, this is called a ______ backup. Choose one a. Differential b. Full c. Partial d. Copy
55. When you back up only the files that have changed since the last backup, this is called a ______ backup. Choose one a. Partial b. Differential c. Full d. Copy
56. The easiest, most basic form of backing up a file is to _____ it to another location.
57. When is the most important time to restore a file from your backup? Choose one a. On a regular scheduled basis to verify that the data is available. b. When the system crashes. c. When a user inadvertently loses a file. d. When your boss asks to see how restoring a file works.
58. As a system administrator, you are instructed to backup all the users' home directories. Which of the following commands would accomplish this? Choose one a. tar rf usersbkup home/* b. tar cf usersbkup home/* c. tar cbf usersbkup home/* d. tar rvf usersbkup home/*
59. What is wrong with the following command? tar cvfb / /dev/tape 20 Choose one a. You cannot use the c option with the b option. b. The correct line should be tar -cvfb / /dev/tape20. c. The arguments are not in the same order as the corresponding modifiers. d. The files to be backed up have not been specified.
60. You need to view the contents of the tarfile called MyBackup.tar. What command would you use? __________
61. After creating a backup of the users' home directories called backup.cpio you are asked to restore a file called memo.ben. What command should you type?
62. You want to create a compressed backup of the users' home directories so you issue the command gzip /home/* backup.gz but it fails. The reason that it failed is that gzip will only compress one _______ at a time.
63. You want to create a compressed backup of the users' home directories. What utility should you use?
64. You routinely compress old log files. You now need to examine a log from two months ago. In order to view its contents without first having to decompress it, use the _________ utility.
65. Which two utilities can you use to set up a job to run at a specified time? Choose one: a. at and crond b. atrun and crontab c. at and crontab d. atd and crond
66. You have written a script called usrs to parse the passwd file and create a list of usernames. You want to have this run at 5 am tomorrow so you can see the results when you get to work. Which of the following commands will work? Choose one: a. at 5:00 wed usrs b. at 5:00 wed -b usrs c. at 5:00 wed -l usrs d. at 5:00 wed -d usrs
67. Several of your users have been scheduling large at jobs to run during peak load times. How can you prevent anyone from scheduling an at job? Choose one: a. delete the file /etc/at.deny b. create an empty file called /etc/at.deny c. create two empty files: /etc/at.deny and /etc/at.allow file d. create an empty file called /etc/at.allow
68. How can you determine who has scheduled at jobs? Choose one: a. at -l b. at -q c. at -d d. atwho
69. When defining a cronjob, there are five fields used to specify when the job will run. What are these fields and what is the correct order? Choose one: a. minute, hour, day of week, day of month, month b. minute, hour, month, day of month, day of week c. minute, hour, day of month, month, day of week d. hour, minute, day of month, month, day of week
70. You have entered the following cronjob. When will it run? 15 * * * 1,3,5 myscript Choose one: a. at 15 minutes after every hour on the 1st, 3rd and 5th of each month. b. at 1:15 am, 3:15 am, and 5:15 am every day c. at 3:00 pm on the 1st, 3rd, and 5th of each month d. at 15 minutes after every hour every Monday, Wednesday, and Friday
71. As the system administrator you need to review Bob's cronjobs. What command would you use? Choose one: a. crontab -lu bob b. crontab -u bob c. crontab -l d. cronq -lu bob
72. In order to schedule a cronjob, the first task is to create a text file containing the jobs to be run along with the time they are to run. Which of the following commands will run the script MyScript every day at 11:45 pm? Choose one: a. * 23 45 * * MyScript b. 23 45 * * * MyScript c. 45 23 * * * MyScript d. * * * 23 45 MyScript
73. Which daemon must be running in order to have any scheduled jobs run as scheduled? Choose one: a. crond b. atd c. atrun d. crontab
74. You want to ensure that your system is not overloaded with users running multiple scheduled jobs. A policy has been established that only the system administrators can create any scheduled jobs. It is your job to implement this policy. How are you going to do this? Choose one: a. create an empty file called /etc/cron.deny b. create a file called /etc/cron.allow which contains the names of those allowed to schedule jobs. c. create a file called /etc/cron.deny containing all regular usernames. d. create two empty files called /etc/cron.allow and /etc/cron.deny
75. You notice that your server load is exceptionally high during the hours of 10 am to 2 noon. When investigating the cause, you suspect that it may be a cron job scheduled by one of your users. What command can you use to determine if your suspicions are correct? Choose one: a. crontab -u b. crond -u c. crontab -l d. crond -l
76. One of your users, Bob, has created a script to reindex his database. Now he has it scheduled to run every day at 10:30 am. What command should you use to delete this job. Choose one: a. crontab -ru bob b. crontab -u bob c. crontab -du bob d. crontab -lu bob
77. What daemon is responsible for tracking events on your system?
78. What is the name and path of the default configuration file used by the syslogd daemon?
79. You have made changes to the /etc/syslog.conf file. Which of the following commands will cause these changes to be implemented without having to reboot your computer? Choose one: a. kill SIGHINT `cat /var/run/syslogd.pid` b. kill SIGHUP `cat /var/run/syslogd.pid` c. kill SIGHUP syslogd d. kill SIGHINT syslogd
80. Which of the following lines in your /etc/syslog.conf file will cause all critical messages to be logged to the file /var/log/critmessages? Choose one: a. *.=crit /var/log/critmessages b. *crit /var/log/critmessages c. *=crit /var/log/critmessages d. *.crit /var/log/critmessages
81. You wish to have all mail messages except those of type info to the /var/log/mailmessages file. Which of the following lines in your /etc/syslogd.conf file would accomplish this? Choose one: a. mail.*;mail!=info /var/log/mailmessages b. mail.*;mail.=info /var/log/mailmessages c. mail.*;mail.info /var/log/mailmessages d. mail.*;mail.!=info /var/log/mailmessages
82. What is the name and path of the main system log?
83. Which log contains information on currently logged in users? Choose one: a. /var/log/utmp b. /var/log/wtmp c. /var/log/lastlog d. /var/log/messages
84. You have been assigned the task of determining if there are any user accounts defined on your system that have not been used during the last three months. Which log file should you examine to determine this information? Choose one: a. /var/log/wtmp b. /var/log/lastlog c. /var/log/utmp d. /var/log/messages
85. You have been told to configure a method of rotating log files on your system. Which of the following factors do you not need to consider? Choose one: a. date and time of messages b. log size c. frequency of rotation d. amount of available disk space
86. What utility can you use to automate rotation of logs?
87. You wish to rotate all your logs weekly except for the /var/log/wtmp log which you wish to rotate monthly. How could you accomplish this. Choose one: a. Assign a global option to rotate all logs weekly and a local option to rotate the /var/log/wtmp log monthly. b. Assign a local option to rotate all logs weekly and a global option to rotate the /var/log/wtmp log monthly. c. Move the /var/log/wtmp log to a different directory. Run logrotate against the new location. d. Configure logrotate to not rotate the /var/log/wtmp log. Rotate it manually every month.
88. You have configured logrotate to rotate your logs weekly and keep them for eight weeks. You are running our of disk space. What should you do? Choose one: a. Quit using logrotate and manually save old logs to another location. b. Reconfigure logrotate to only save logs for four weeks. c. Configure logrotate to save old files to another location. d. Use the prerotate command to run a script to move the older logs to another location.
89. What command can you use to review boot messages?
90. What file defines the levels of messages written to system log files?
91. What account is created when you install Linux?
92. While logged on as a regular user, your boss calls up and wants you to create a new user account immediately. How can you do this without first having to close your work, log off and logon as root? Choose one: a. Issue the command rootlog. b. Issue the command su and type exit when finished. c. Issue the command su and type logoff when finished. d. Issue the command logon root and type exit when finished.
93. Which file defines all users on your system? Choose one: a. /etc/passwd b. /etc/users c. /etc/password d. /etc/user.conf
94. There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order? Choose one: a. username, UID, GID, home directory, command, comment b. username, UID, GID, comment, home directory, command c. UID, username, GID, home directory, comment, command d. username, UID, group name, GID, home directory, comment
95. Which of the following user names is invalid? Choose one: a. Theresa Hadden b. thadden c. TheresaH d. T.H.
96. In order to prevent a user from logging in, you can add a(n) ________at the beginning of the password field.
97. The beginning user identifier is defined in the _________ file.
98. Which field is used to define the user's default shell?
99. Bob Armstrong, who has a username of boba, calls to tell you he forgot his password. What command should you use to reset his command?
100. Your company has implemented a policy that users' passwords must be reset every ninety days. Since you have over 100 users you created a file with each username and the new password. How are you going to change the old passwords to the new ones? Choose one: a. Use the chpasswd command along with the name of the file containing the new passwords. b. Use the passwd command with the -f option and the name of the file containing the new passwords. c. Open the /etc/passwd file in a text editor and manually change each password. d. Use the passwd command with the -u option.