Sie sind auf Seite 1von 53

Core Java FAQs

1. What is the difference between an Abstract class and Interface?


2. What are checked and unchecked exceptions?
3. What is a user defined exception?
4. What is the difference between C++ & Java?
5. What are statements in JAVA ?
6. What is JAR file?
7. What is JNI?
8. What is serialization?
9. Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA?
10. Is synchronised a modifier? identifier? what is it??
11. What is singleton class? where is it used?
12. What is a compilation unit?
13. Is string a wrapper class?
14. Why java does not have multiple inheritance?
15. Why java is not a 100% oops?
16. What is a resource bundle?
17. What is transient variable?
18. What is Collection API?
19. Is Iterator a Class or Interface? What is its use?
20. What is similarities/difference between an Abstract class and Interface?
21. What is a transient variable?
22. Which containers use a border Layout as their default layout?
23. Why do threads block on I/O?
24. How are Observer and Observable used?
25. What is synchronization and why is it important?
26. Can a lock be acquired on a class?
27. What's new with the stop(), suspend() and resume() methods in JDK 1.2?
28. Is null a keyword?
29. What is the preferred size of a component?
30. What method is used to specify a container's layout?
31. Which containers use a FlowLayout as their default layout?
32. What state does a thread enter when it terminates its processing?
33. What is the Collections API?
34. Which characters may be used as the second character of an identifier, but not as the first character of
an identifier?.
35. What is the List interface?
36. How does Java handle integer overflows and underflows?
37. What is the Vector class?
38. What modifiers may be used with an inner class that is a member of an outer class?
39. What is an Iterator interface?
40. What is the difference between the >> and >>> operators?
41. Which method of the Component class is used to set the position and size of a component?
42. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
43. What is the difference between yielding and sleeping?
44. Which java.util classes and interfaces support event handling?
45. Is sizeof a keyword?
46. What are wrapped classes?
47. Does garbage collection guarantee that a program will not run out of memory?
48. What restrictions are placed on the location of a package statement within a source code file?
49. Can an object's finalize() method be invoked while it is reachable?
50. What is the immediate superclass of the Applet class?
51. What is the difference between preemptive scheduling and time slicing?
52. Name three Component subclasses that support painting.
53. What value does readLine() return when it has reached the end of a file?
54. What is the immediate superclass of the Dialog class?

55. What is clipping?


56. What is a native method?
57. Can a for statement loop indefinitely?
58. What are order of precedence and associativity, and how are they used?
59. When a thread blocks on I/O, what state does it enter?
60. To what value is a variable of the String type automatically initialized?
61. What is the catch or declare rule for method declarations?
62. What is the difference between a MenuItem and a CheckboxMenuItem?
63. What is a task's priority and how is it used in scheduling?
64. What class is the top of the AWT event hierarchy?
65. When a thread is created and started, what is its initialstate?
66. Can an anonymous class be declared as implementingan interface and extending a class?
67. What is the range of the short type?
68. What is the range of the char type?
69. In which package are most of the AWT events thatsupport the event-delegation model defined?
70. What is the immediate superclass of Menu?
71. What is the purpose of finalization?
72. Which class is the immediate superclass of theMenuComponent class.
73. What invokes a thread's run() method?
74. What is the difference between the Boolean & operatorand the && operator?
75. Name three subclasses of the Component class.
76. What is the GregorianCalendar class?
77. Which Container method is used to cause a containerto be laid out and redisplayed?
78. What is the purpose of the Runtime class?
79. How many times may an object's finalize() method beinvoked by the garbage collector?
80. What is the purpose of the finally clause of a try-catchfinally statement?
81. What is the argument type of a program's main()method?
82. Which Java operator is right associative?
83. What is the Locale class?
84. Can a double value be cast to a byte?
85. What is the difference between a break statement anda continue statement?
86. What must a class do to implement an interface?
87. What method is invoked to cause an object to beginexecuting as a separate thread?
88. Name two subclasses of the TextComponent class.
89. What is the advantage of the event-delegation modelover the earlier eventinheritance model?
90. Which containers may have a MenuBar?
91. How are commas used in the intialization and iterationparts of a for statement?
92. What is the purpose of the wait(), notify(), andnotifyAll() methods?
93. What is an abstract method?
94. How are Java source code files named?
95. What is the relationship between the Canvas class and the Graphics class?
96. What are the high-level thread states?
97. What value does read() return when it has reached the end of a file?
98. Can a Byte object be cast to a double value?
99. What is the difference between a static and a nonstaticinner class?
100.What is the difference between the String and StringBuffer classes?
101.If a variable is declared as private, where may the variable be accessed?
102.What is an object's lock and which object's have locks?
103.What is the Dictionary class?
104.How are the elements of a BorderLayout organized?
105.How are the elements of a BorderLayout organized?
106.When can an object reference be cast to an interfacereference?
107.What is the difference between a Window and aFrame?
108.Which class is extended by all other classes?
109.Can an object be garbage collected while it is stillreachable?
110.Is the ternary operator written x : y ? z or x ? y : z ?

111. What is the difference between the Font andFontMetrics classes?


112.How is rounding performed under integer division?
113.What happens when a thread cannot acquire a lockon an object?
114.What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream
classhierarchy?
115.What classes of exceptions may be caught by a catchclause?
116.If a class is declared without any access modifiers,where may the class be accessed?
117.What is the SimpleTimeZone class?
118.What is the Map interface?
119.Does a class inherit the constructors of itssuperclass?
120.For which statements does it make sense to use alabel?
121.What is the purpose of the System class?
122.Which TextComponent method is used to set aTextComponent to the read-only state?
123. How are the elements of a CardLayout organized?
124.Is &&= a valid Java operator?
125.Name the eight primitive Java types?
126.Which class should you use to obtain designinformation about an object?
127.What is the relationship between clipping andrepainting?
128.Is "abc" a primitive value?
129.What is the relationship between an event-listenerinterface and an event-adapter class?
130.What restrictions are placed on the values of eachcase of a switch statement?
131.What modifiers may be used with an interfacedeclaration?
132.Is a class a subclass of itself?
133.What is the highest-level event class of the eventdelegationmodel?
134.What event results from the clicking of a button?
135.How can a GUI component handle its own events?
136.What is the difference between a while statementand a do statement?
137.How are the elements of a GridBagLayout organized?
138.What advantage do Java's layout managers provideover traditional windowing systems?
139.What is the Collection interface?
140.What modifiers can be used with a local inner class?
141.What is the difference between static and non-staticvariables?
142.What is the difference between the paint() andrepaint() methods?
143.What is the purpose of the File class?
144.Can an exception be rethrown?
145.Which Math method is used to calculate the absolutevalue of a number?
146.How does multithreading take place on a computerwith a single CPU?
147.When does the compiler supply a default constructorfor a class?
148.When is the finally clause of a try-catch-finallystatement executed?
149.Which class is the immediate superclass of theContainer class?
150.If a method is declared as protected, where may themethod be accessed?
151.How can the Checkbox class be used to create a radiobutton?
152.Which non-Unicode letter characters may be used asthe first character of an identifier?
153.What restrictions are placed on method overloading?
154.What happens when you invoke a thread's interruptmethod while it is sleeping or waiting?
155.What is casting?
156.What is the return type of a program's main()method?
157.Name four Container classes.
158.What is the difference between a Choice and a List?
159.What class of exceptions are generated by the Javarun-time system?
160.What class allows you to read objects directly from astream?
161.What is the difference between a field variable and alocal variable?
162.Under what conditions is an object's finalize()method invoked by the garbage collector?
163.How are this() and super() used with constructors?
164.What is the relationship between a method's throws clause and the exceptions that can be thrown during
the method's execution??

165.What is the difference between the JDK 1.02 event model and the event-delegation model introduced
withJDK 1.1?
166.How is it possible for two String objects withidentical values not to be equal under the == operator?
167.Why are the methods of the Math class static?
168.What Checkbox method allows you to tell if aCheckbox is checked?
169.What state is a thread in when it is executing?
170.What are the legal operands of the instanceofoperator?
171. How are the elements of a GridLayout organized?
172.What an I/O filter?
173.If an object is garbage collected, can it becomereachable again?
174.What is the Set interface?
175.What classes of exceptions may be thrown by a throwstatement?
176.What are E and PI?
177.Are true and false keywords?
178.What is a void return type?
179.What is the purpose of the enableEvents() method?
180.What is the difference between the File andRandomAccessFile classes?
181.What happens when you add a double value to aString?
182.What is your platform's default character encoding?
183.Which package is always imported by default?
184.What interface must an object implement before itcan be written to a stream as an object?
185.How are this and super used?
186.What is the purpose of garbage collection?
187.What is a compilation unit?
188. What interface is extended by AWT event listeners?
189.What restrictions are placed on method overriding?
190.How can a dead thread be restarted?
191.What happens if an exception is not caught?
192.What is a layout manager?
193.Which arithmetic operations can result in thethrowing of an ArithmeticException?
194.What are three ways in which a thread can enter thewaiting state?
195.Can an abstract class be final?
196.What is the ResourceBundle class?
197.What happens if a try-catch-finally statement does not have a catch clause to handle an exception that
is thrown within the body of the try statement?
198.What is numeric promotion?
199.What is the difference between a Scrollbar and aScrollPane?
200.What is the difference between a public and a nonpublicclass?
201.To what value is a variable of the boolean typeautomatically initialized?
202.Can try statements be nested?
203.What is the difference between the prefix and postfixforms of the ++ operator?
204.What is the purpose of a statement block?
205.What is a Java package and how is it used?
206.What modifiers may be used with a top-level class?
207.What are the Object and Class classes used for?
208.How does a try statement determine which catchclause should be used to handle an exception?
209.Can an unreachable object become reachable again?
210. When is an object subject to garbage collection?
211.What method must be implemented by all threads?
212.What methods are used to get and set the text labeldisplayed by a Button object?
213.Which Component subclass is used for drawing andpainting?
214.What are synchronized methods and synchronizedstatements?
215.What are the two basic ways in which classes thatcan be run as threads may be defined?
216.What are the problems faced by Java programmerswho don't use layout managers?
217.What is the difference between an if statement and aswitch statement?
218.What happens when you add a double value to aString?

219.What is the List interface?


Collections
1. What are limitations of object Arrays?
2. What are differences between arrays and collections?
3. what are differences between arrays and ArrayList?
4. What are differences between arrays and Vector?
5. What is Collection API ?
6. What is Collection framework?
7. What is difference between Collections and Collection?
8. Explain about Collection interface?
9. Explain about List interface?
10. Explain about Set interface?
11. Explain about SortedSet interface?
12. Explain about NavigableSet ?
13. Explain about Queue interface?
14. Explain about Map interface?
15. Explain about SortedMap ?
16. Explain about NavigableMap?
17. Explain about ArrayList class?
18. What is RandomAccess Interface?
19. Explain about LinkedList class?
20. Explain about Vector class?
21. What is difference between ArrayList and Vector?
22. How we can get synchronized version of ArrayList?
23. What is difference between size and capacity of a Collection Object?
24. What is difference between ArrayList and Linked List?
25. What are legacy classes and interfaces present in Collections framework ?
26. what is difference Enumeration and Iterator?
27. What are limitations of Enumeration?
28. What is difference between enum and Enumeration?
29. What is difference between Iterator and ListIterator?
30. What is relation between ListIterator and Iterator?
31. Explain about HashSet class?
32. If we are trying to insert duplicate values in Set what will happen?
33. What is LinkedHashSet?
34. Differences between HashSet and LinkedHashSet?
35. What are major enhancements in 1.4 version of collection frame work?
36. Explain about TreeSet?
37. What are differences between List and Set interfaces?
38. What is Comparable interface?
39. What is Comparator interface?
40. What are differences between Comparable and Comparator?
41. What is difference between HashSet and TreeSet?
42. What is Entry interface?
43. Explain about HashMap?
44. Explain about LinkedHashMap?
45. Differences between HashMap and LinkedHashMap ?
46. Differences between HashMap and Hashtable?
47. What is IdentityHashMap?
48. What is difference between HashMap and IdentityHashMap?
49. What is WeakHashMap?
50. What is difference between HashMap and WeakHashMap?
51. What is TreeMap?
52. What is Hashtable
53. What is PriorityQueue?
54. What is Arrays class?

55. We are planning to do an indexed search in a list of objects. Which of the two Java collections should
you use: ArrayList or LinkedList?
56. Why ArrayList is faster than Vector?
Exception Handling FAQs
1. What is an Exception?
2. What is the purpose of Exception Handling?
3. What is the meaning of Exception Handling?
4. Explain Default Exception Handling Mechanism in java?
5. What is the purpose of try?
6. What is the purpose of catch block?
7. Is try with multiple catch block is possible?
8. If try with multiple catch block present is order of catch blocks important in which order we have to take?
9. What are various methods to print Exception information? and differentiate them.
10. If an exception rised inside catch block then what will happen?
11. Is it possible to take try, catch inside try block?
12. Is it possible to take try, catch inside catch block?
13. Is it possible to take try without catch?
14. What is the purpose of finally block?
15. Is finally block will be execute always?
16. In which situation finally block will not executed?
17. If return statement present inside try is finally block will be executed?
18. What is the difference between final, finally and finalize()?
19. Is it possible to write any statement between try-catch and finally?
20. Is it possible to take two finally blocks for the same try?
21. Is syntax try-finally-catch is valid ?
22. What is the purpose of throw?
23. Is it possible to throw an Error?
24. Is it possible to throw any java object?
25. After throw is it allow to take any statement directly?
26. What is the purpose of throws?
27. What is the difference between throw and throws?
28. What is the difference between throw and thrown?
29. Is it possible to use throws keyword for any java class?
30. If we are taking catch block for an exception but there is no chance of rising that exception in try then
what will happen?
31. Explain Exception Handling keyword?
32. Which class act as root for entire java Exception hierarchy?
33. What is the difference between Error and Exception?
34. What is difference between checked exception and unchecked exception?
35. What is difference between partially checked and fully checked Exception?
36. What is a customized Exception?
37. Explain the process of creating the customized Exception.
38. Explain control flow in try, catch, finally.
39. Can you give the most common occurred exception in your previous project.
40. Explain the cases where you used Exception Handling in your previous project?
Multi Threading FAQs
1. What is Multitasking?
2. What is the difference between process-based and Thread-based Multitasking?
3. What is Multithreading and explain its application areas?
4. What is advantage of Multithreading?
5. When compared with C++ what is the advantage in java with respect to Multithreading?
6. In how many ways we can define a Thread? Among extending Thread and implementing Runnable which
is recommended?
7. What is the difference between t.start() and t.run() method?
8. Explain about Thread Scheduler?
9. If we are not overriding run() method what will happened?

10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.

Is overloading of run() method is possible?


Is it possible to override start() method?
we are overriding start() method then what will happen?
Explain life cycle of a Thread?
What is the importance of Thread class start() method?
After starting a Thread if we trying to restart the same thread once again what will happen?
Explain Thread class constructors?
How to get and set name of a Thread?
What is the range of Thread priority in java?
Who uses Thread priority?
Once we created a new Thread what about its priority?
How to get and set priority of a Thread?
If we are trying to set priority of a Thread as 100 what will happen?
If two threads having same priority then which thread will get chance first for execution?
If two threads having different priority then which thread will get chance first for execution?
How we can prevent a thread from execution?
What is yield() method? Explain its purpose?
What is purpose of join() method?
Is join() method is overloaded?
What is the purpose of sleep() method?
What is synchronized keyword? Explain its advantages and disadvantages.
Where we can use synchronized keyword?
What is object lock? Explain when it is required?
What is the class level lock? Explain its purpose.
While a thread executing any synchronized method on the given object is it possible to execute remaining
synchronized method of the same object simultaneously by any other thread?
What is the difference between synchronized method and static synchronized method?
What is the advantage of synchronized block over synchronized method?
What is synchronized statement?
How we can declare synchronized block to get class level lock?
How two thread will communicate with each other?
wait(), notify(), notifyAll() method can available in which class?
Why wait(), notify(), notifyAll() method defines in object class instead of Thread class?
If a waiting thread got notification then it will entered into which state?
In which method threads can release the lock?
Explain wait(), notify(), notifyAll() method uses.
What is the difference between notify() and notifyAll()?
Once a Thread got the notification then which waiting thread will get chance?
How a thread can interrupt another thread?
What is DeadLock? Is it possible to resolve DeadLock situation?
Which keyword causes DeadLock situation?
How we can stop a thread explacitly?
Explain about suspend() and resume() method?
What is Starvation()? And Explain the difference between Deadlock and Starvation?
What is race condition?
What is Daemon Thread? And give an example?
What is the purpose of a Daemon Thread?
How we can check Daemon nature of a Thread?
Is it possible to change a Daemon nature of a Thread?
Is main thread is Daemon or non-daemon?
Once we created a new thread is it daemon or non-daemon.
After starting a thread is it possible to change Daemon nature?
When the Daemon thread will be terminated?
What is green Thread?
Explain about Thread group?
What is the Thread Local?

65. In your previous project where you used multithreading concept?


JDBC FAQs
1. What is the difference between Database and Database management system?
2. How a query could be executed when we send a query to Database?
3. What is Driver? How many Drivers are available in JDBC? What are the types?
4. What is JDBC and What are the steps to write a JDBC application?
5. How to load a JDBC driver?
6. How to establish a Database connection between java application and Database?
7. Basically Connection is an interface, how getConnection() will create an object for Connection interface?
8. What is the requirement to use Statement object?
9. How to execute SQL Queries from a java application?
10. What are the differences between executeQuery(), executeUpdate() and execute() methods?
11. How to create a table dynamically from a jdbc application?.
12. How to insert records into a table from a JDBC application?
13. How to update a table from a jdbc application?.
14. How to delete records from a table from jdbc application?.
15. What is ment by ResultSet object and How to Fetch the Data from Database?.
16. Ingeneral execute() method can be used to execute selection group SQl queries for getting the data from
Database , but execute() return a boolean value true so here how it possible to fetch the data from database?
17. Ingeneral execute() method can be used to execute updatation group SQl queries for updating the data on
Database , but execute() return a boolean value false so here how it possible to get the records updated
count value(int value)?
18. If we use selection group SQL query to executeUpdate() ,what happened?
19. If we use updatation group SQL query to executeQuery() ,what happened?
20. What is ment by ResultSet and What are the types of ResultSets are available in JDBC application?
21. What is the difference between ScrollSensitive ResultSet and ScrollInsensitive ResultSets?
22. What is the default ResultSet type in JDBC application and How it is possible to create a specific type of
ResultSet object?
23. How to iterate the data from Scrollable ResultSet objuect in both forward and backword direction?
24. How to generate ScrollSensitive Result Set and how to reflect the later updations from database
automatically to the ResultSet object?
25. How to insert records into Database throws Updatable ResultSet?
26. How to perform updations on Database throws Updatable ResultSet?
27. What is meant by ResultSetMetaData ?How to get The ResultSet metadata of a ResultSet object?
28. How to display the data with the respective field names
29. What are the differences between Statement and PreparedStatement? (or) Tell me the situations where we
should go for PreparedStatement over Statement object.
30. Hhow to insert number of records into a table through Prepared Statement object.
31. How to update the database through PreparedStatement object.
32. How to fetch the data from database through PreparedStatement object.
33. What is meant by Transaction? How it is possible to maintain Transactions in JDBC applications?
34. What is meant by SavePoint?How to use Savepoints in JDBC applications?
Servlets FAQs
1. In How many ways we can develop a servlet?
2. What is the difference between CGI & Servlet?
3. What is the difference between traditional & Fast CGI?
4. What is the difference between ServletConfig & ServletContext?
5. How to define a Servlet?
6. Specify parallel technologies to the servlet?
7. What is the difference between web server & web container?
8. What is the difference between web server & application server?
9. What are the various types of web containers?
10. By using which 2 Packages we can implement Servlet?
11. What is the purpose of RequestDispatcher?
12. What methods we can call on RequesrDispatcher Object?
13. Explain about SingleThreadModeal?

14. Explain about SingleThreadModeal?


15. What are the various methods present in SingleThreadModeal?
16. What is the marker interface? Example?
17. By using which interfaces we can implements Filter concept?
18. What are the various listeners are available in Servlet specification?
19. What are the various Event classes present in Servlet Specification?
20.By using which object we can send text data as response from the Servlet?
21.By using which object we can read binary data send by the client?
22. By using which object we can send binary data send as response from the Servlet?
23.What are the (various ) lifecycle methods of the Servlet?
24.Explain the purpose of the init() method & How many times it will be excuted? When it will be executed?
Q25.If init() method throws any Exception i.e; if init() method fails to execute then what will be happen?
26.Is it possible to write constructor with in the Servlet?
27.Why init() is required to perform initialization activities instead of constructor?
28.Is it possible to perform Initialization activities with in the constructor?
29.What is the purpose of service() & How Many times it will be Executed?
30.Explain about destroy?
31.Is it Possible to call destroy() method explicitly from service?
32. With in the <servlet-mapping> how many url pattrerns taken at a time?
33.Explain LifeCycle of the Servlet?
34.What is the purpose of <load-on-startup>?
35.What is the significance of the number for <load-on-startup>?
36.If two servlets having same <load-on-startup>value then which wii be loaded first?
37.Explain about GenericServlet?
38.Which interfaces are implemented by GenericServlet?
39.What is the necessity of having 2 init() methods with in the Servlet?
40.Explain best way of overriding init()?
41.What are various possible status code of response?
42.Explain the difference between GET&POST?
43.What are various HttpRequest methods?
44.What is the difference between HEAD&GET?
45.What is the difference between PUT&GPOST?
46.Which Http methods are non-idempotent?
47.Which Http methods are idempotent?
48.In how many ways we can trigger a GET request?
49.What is the default method for the form?
50.What are different ways to trigger POST request?
51.How many service() methods available in HttpServlet?
52.Explain life cycle of getRequest?
53.Is it recommended to override service() in Http based Servlet?
54.If you are sending Get request but our Servlet contains doGet() & service() Methods then which method will be
executed?
55.If you are sending Get request but our Servlet doesn't contain doGet() what happen?
56.Even though HttpServlet doesn't contain any abstract method why it is declared as abstract class?
57.What are the various methods to retrieve from parameters?
58.What is the purpose of request Headers?
59.How we can retrieve headers associated with the ServletRequest?
60. To what value is a variable of the String type automatically initialized?How we can retrieve cookies from the
request?
61.By using which method we can get client &server information from the request?
62.How we can add response headers to the ServletResponse?
63.How we can set ContentType to the response?
64.What is the MIME type?
65.Is it possible to send multiple content type as response from the same servlet?
66.Write Servlet code to send movie file as response?
67.Is it possible to get PrintWriter & ServletOutputStream objects simultaneously?

68.How we can implement Redirection mechanism?


69.Explain, difference between sendRedirect&forword?
70.How many times we can call sendRedirect() method with in the same Servlet?
71.How we can add cookies to the response?
72.Explain the directory structure of a web application?
73.In which location we have to place static content?
74.Is it possible to access resources present in the context root directly?
75.Is WEB-INF folder mandatory for web application?
76.Explain about web.xml?
77.Where we have to place 3rd party jar files?
78.If the required class file available in classes folder and lib folder jar file, then which one will get preference?
79.Is there any alternate location to place servlet .class file Other than classes folder?
80.Is it possible to access web.xml directory?
81.Where we have to place tag libraries inside web application?
82.Is it important the order of tags in the web.xml?
83.Can you specify any 10 tags of web.xml?
84.With in the <web-app> which tags are mandatory?
85.What is the purpose of <servlet-name>
86.How many names are possible for a servlet in web-app?
87.Is it possible to configure jsp's in web.xml?
88.When we have to configure jsp's in web.xml?
89.What is the purpose of Servlet initialization parameters and explain how to configure in web.xml?
90.With in the servlet how we can access logical name of the servlet?
91.With in the servlet how we can access Servlet initialization parameter?
92.What is the ServletConfig object and explain the methods available in ServletConfig interface?
93.What is the purpose of <load-on-startup>explain its advantages & disadvantages?
94.If two Servlets having same<load-on-startup> values what will be happen?
95.How many types of url patterns are possible according to Servlet specification?
96.With in the <servlet-mapping>how many url pattrern tags we can take?
97.How to configure defult Servlet in web.xml and when it will get chance for execution?
98.What is the difference between url, uri & urn?
99.How we can get Contextpath and quereyString directly with in the Servlet?
100.What is the necessity of welcome-file and explain How to configure welcome files in web.xml?
101.What is the default welcome-file?
102. Is it possible to configure welcome file in folder wise?
103.What is the necessity of error page and explain the process of Configuration in web.xml?
104.How to send ErrorCode programmatically?
105.What is the purpose of <mime-mapping>?
106.Explain about of war file & the process of creation?
107.What is the purpose of META-INF folder?
108.Explain about MANIFEST.MF?
109.Explain about <context-param>tag & <init-param>?
110.What are the differences between Servlet initialization parameters& Context initialization parameters?
111.How we can access context parameters and servlet parameters with in the Servlet?
112.How we can declare context & Servlet <init-parameters>in web.xml?
113.What is the scope of <context-param>&<init-param>?
114.What are the difference between parameters & attributes?classhierarchy?
115.What is the purpose of an attribute?
116.What are various scopes available for Servlets?
117.Explain the cases where we should go for each scope?
118.explain the methods to perform following activities?
1. a) Adding an attribute?
2. b) Get the name of an attribute?
3. c) Remove an attribute?
4. d) Modify the value of an attribute?
5. e) To display all attribute names present in a specified scope?

119.If we store information in application scope by default it is available everywhere with in the web application,
then what is the need of session and Request scopes?
120.What is the purpose of RequestDispatcher?
121.How many possible ways we can get the RequestDispatcher?
122.What is the difference between obtaining RequestDispatcher from ServletRequest and ServletContext object?
123.What is the difference between forward() &include()?
124.What is the difference between forward() &sendRedirect()?
125.What is the foreign RequestDispatcher & explain the process how we can get it?
126.What are various attributes added by web container while forwarding & including?
What is the purpose of
these attributes?
127.What is the purpose of filter? Explain the cases where exactly required?
128.By using which interfaces we can implement filter concepts?
129. What is the purpose of FilterChain?
130.How we can configure filter in web.xml?
131.In how many ways we can map a filter?
132.What is the purpose of <dispatcher> tag?
133.What are the default values of <dispatcher> tag?
134.What are allowed values of <dispatcher> tag?
135.In filter chain in which order the filters will be executed?
136.What is the difference between Filter interface doFilter() & FilterChain doFilter()?
137.What is the intercepting filter design pattern?
138.What is the purpose of wrapper?
139.Explain the types of wrappers?
140.Explain Decorator design pattern?
141.Explain the cases where you used filters & wrappers in your previous project?
142.What is the need of Session Management? Explain cases where Session Management is required with
example?
143.What are the various Session Management techniques are available?
144.Explain the process of creating Session object?
145.What is the difference between getSession() & getSession(boolean b)?
146.Explain with an example where getSession(false) is required?
147.How we can invalidate a Session?
148.Define Session management?
149.How we can configure SessionTimeout in web.xml?
150.What is the difference between <Session-timeout>and <SetMaxInactiveInterval>?
151.How to know SessionCreation time & lastaccesed time?
152.Explain the Session Management Mechanism by SessionAPI?
153.What is the default session timeout?
154.Explain Session Management by using Cookies?
155.How the SessionId is exchanging between Client & Server?
156.What is the difference between Session API & Cookie which approach is recommended?
157.What is the difference between persistent and non persistent cookies?
158.What is URL Rewriting?
159.By using which Methods we can implement URLRewriting?
160.BY using which methods we can identify under laying Session Management technique?
161.Explain advantages & disadvantages of
6. cookies
7. URL Writing
8. Session API
162.Explain the purpose of Listener?
163.What are the various listeners are available according to Servlet specification?
164.What is the difference between ServletRequestListener and ServletRequestAttributeListener?
165.How to configure listener in web.xml?
166.To print hit count of the web application which listener is required to use?
167.To print the no of active session objects at server side which listener is responsible?
168.What is the difference between HSAL & HSBL?

169.What are various methods present in binding listeners?


170.Explain about HttpSessionActivationListener?
171.At the time of application deployment to perform certain activities which listener is responsible?
172.What are various listeners which are not required to configure in web.xml?
173.What are various event classes available in ServletSpecification?
174.Is it possible to configure more than one listener of same type?
175.If you are configures more than one listener of the same type then in which order listener will be executed?
176.Who is responsible to perform instantiation of listener?
177.At what time listener classes will be instantiated?
178.What is the difference between declarative Security & programmatic security?
179.By using which methods we can implement programmatic Security?
180.What is the purpose of <security-role-ref>?
181.How we can configure users in Tomcat?
182.In your previous project how you implement security?
183.In your previous project what type of authentication used?
JSP FAQs
1. What is JSP ? Describe its concept.
2 . Explain the benefits of JSP?
3. Is JSP technology extensible?
4 .Can we implement an interface in a JSP?
5 What are the advantages of JSP over Servlet?
6. Differences between Servlets and JSP?
7 . Explain the differences between ASP and JSP?
8 . Can I stop JSP execution while in the midst of processing a request?
9. How to Protect JSPs from direct access ?
10. Explain JSP API ?
11. What are the lifecycle phases of a JSP?
12. Explain the life-cycle mehtods in JSP?
13. Difference between _jspService() and other life cycle methods.
14 What is the jspInit() method?
15. What is the _jspService() method?
16. What is the jspDestroy() method?
17. What JSP lifecycle methods can I override?
18. How can I override the jspInit() and jspDestroy() methods within a JSP page?
19 . Explain about translation and execution of Java Server pages?
20 . Why is _jspService() method starting with an '_' while other life cycle methods do not?
21. How to pre-compile JSP?
22. The benefits of pre-compiling a JSP page?
23.How many JSP scripting elements and explain them?
24. What is a Scriptlet?
25. What is a JSP declarative?
26. How can I declare methods within my JSP page?
27. What is the difference b/w variable declared inside a declaration and variable declared in scriplet ?
28.What are the three kinds of comments in JSP and what's the difference between them?
29. What is output comment?
30. What is a Hidden Comment?
31. How is scripting disabled?
32. What are the JSP implicit objects?
33. How does JSP handle run-time exceptions?
34. How can I implement a thread-safe JSP page? What are the advantages and Disadvantages of using it?
35. What is the difference between ServletContext and PageContext?
36 . Is there a way to reference the "this" variable within a JSP page?
37 . Can you make use of a ServletOutputStream object from within a JSP page?
38 .What is the page directive is used to prevent a JSP page from automatically creating a session?
39. What's a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or
Synchronization?

40. What are various attributes Of Page Directive ?


41 . Explain about autoflush?
42. How do you restrict page errors display in the JSP page?
43. What are the different scopes available fos JSPs ?
44. when do use application scope?
45. What are the different scope valiues for the ?
46. How do I use a scriptlet to initialize a newly instantiated bean?
47 . Can a JSP page instantiate a serialized bean?
48.How do we include static files within a jsp page ?
49.In JSPs how many ways are possible to perform inclusion?
50.In which situation we can use static include and dynamic include in JSPs ?
51.Differences between static include directive and include action ?
Spring FAQs
What is IOC (or Dependency Injection)?
What are the different types of IOC (dependency injection) ?
What are the benefits of IOC (Dependency Injection)?
What are the advantages of Spring framework?
What are features of Spring ?
What is web module?
What are the types of Dependency Injection Spring supports?
What is Bean Factory ?
What is the difference between Bean Factory and Application Context ?
What are the common implementations of the Application Context ?
How is a typical spring implementation look like ?
What is the typical Bean life cycle in Spring Bean Factory Container ?
What do you mean by Bean wiring ?
What do you mean by Auto Wiring?
What is DelegatingVariableResolver?
How to integrate Java Server Faces (JSF) with Spring?
What is Java Server Faces (JSF) - Spring integration mechanism?
What is Significance of JSF- Spring integration ?
How to integrate your Struts application with Spring?
What are ORMs Spring supports ?
What are the ways to access Hibernate using Spring ?
How to integrate Spring and Hibernate using HibernateDaoSupport?
What are Bean scopes in Spring Framework ?
What is AOP?
How the AOP used in Spring?
What do you mean by Aspect ?
What do you mean by Advice?
What are the types of Advice?
What are the types of the transaction management Spring supports ?
What are the benefits of the Spring Framework transaction management ?
Why most users of the Spring Framework choose declarative transaction management ?
Explain the similarities and differences between EJB CMT and the Spring Framework's declarative transaction
management ?
What are object/relational mapping integratio6 module?
When to use programmatic and declarative transaction management ?
Explain about the Spring DAO support ?
What are the exceptions thrown by the Spring DAO classes ?
What is SQLExceptionTranslator ?
What is Spring's JdbcTemplate ?
What is PreparedStatementCreator ?
What is SQLProvider ?
What is RowCallbackHandler ?
What are the differences between EJB and Spring ?

Do I need any other SOAP framework to run Spring Web Services?


I get NAMESPACE_ERR exceptions when using Spring-WS. What can I do about it?
Does Spring-WS run under Java 1.3?
Does Spring-WS work under Java 1.4?
Does Spring-WS work under Java 1.6?
Why do the Spring-WS unit tests fail under Mac OS X?
What is SAAJ?
What version of SAAJ does my application server support?
I get a NoSuchMethodError when using SAAJ. What can I do about it?
I get an UnsupportedOperationException "This class does not support SAAJ 1.1" when I use SAAJ under WebLogic
9. What can I do about it?
I get an UnsupportedOperationException "This class does not support SAAJ 1.1" when I use SAAJ under
WebLogic 10. What can I do about it?
I get an IndexOutOfBoundsException when I use SAAJ under JBoss. What can I do about it?
Does Spring-WS run on IBM WebSphere?
Why does Spring-WS only support contract-first?
How do I retrieve the WSDL from a Service?
What is web module?
What is a BeanFactory?
What is AOP Alliance?
What is Spring configuration file?
What does a simple spring application contain?
What is XMLBeanFactory?
What are important ApplicationContext implementations in spring framework?
Explain Bean lifecycle in Spring framework?
What is bean wiring?
How do add a bean in spring application?
What are singleton beans and how can you create prototype beans?
What are the important beans lifecycle methods?
How can you override beans default lifecycle methods?
What are Inner Beans?
What are the different types of bean injections?
What is Auto wiring?
What are different types of Autowire types?
What are the different types of events related to Listeners?
What is an Aspect?
What is a Jointpoint?
What is an Advice?
What is a Pointcut?
What is an Introduction in AOP?
What is a Target?
What is a Proxy?
What is meant by Weaving?
What are the different points where weaving can be applied?
What are the different advice types in spring?
What are the different types of AutoProxying?
What kind of exceptions those spring DAO classes throw?
What is DataAccessException?
How can you configure a bean to get DataSource from JNDI?
How can you create a DataSource connection pool?
How JDBC can be used more efficiently in spring framework?
How JdbcTemplate can be used?
How do you write data to backend in spring using JdbcTemplate?
Explain about PreparedStatementCreator?
Explain about BatchPreparedStatementSetter?
Explain about RowCallbackHandler and why it is used?

Hibernate FAQs
1. What is the advantage of Hibernate over jdbc?
2. What is Hibernate?
3. What is ORM ?
4. Hat does ORM consists of ?
5. What are the ORM levels ?
6. Why do you need ORM tools like hibernate?
7. What Does Hibernate Simplify?
8. What is the main difference between Entity Beans and Hibernate ?
9. What are the Core interfaces and classes of Hibernate framework?
10. What is the general flow of Hibernate communication with RDBMS?
11. What is the need for Hibernate mapping file?
12. What are the important tags of hibernate.cfg.xml?
13. What role does the Session interface play in Hibernate?
14. What role does the SessionFactory interface play in Hibernate?
15. What are the most common ways to specify the Hibernate configuration properties?
16. How do you map Java Objects with Database tables?
17. How do you define sequence generated primary key algorithm in hibernate?
18. What is component mapping in Hibernate?
19. Difference between getCurrentSession() and openSession() in Hibernate ?
20. What are the types of Hibernate instance states ?
21. What are the types of inheritance models in Hibernate?
22. What is Hibernate Query Language (HQL)?
23. What are the ways to express joins in HQL?
24. Transaction with plain JDBC in Hibernate ?
25. What are the general considerations or best practices for defining your Hibernate persistent classes?
26. Difference between session.update() and session.lock() in Hibernate ?
27. What are the Collection types in Hibernate ?
28. What is the difference between sorted and ordered collection in hibernate?
29. What do you mean by Named SQL query?
30. How do you invoke Stored Procedures?
31. Explain Criteria API
32. Whats the difference between load() and get()?
33. What is the difference between and merge and update ?
34. Define cascade and inverse option in one-many mapping?
35. Define HibernateTemplate?
36. What are the benefits does HibernateTemplate provide?
37. How do you switch between relational databases without code changes?
38. If you want to see the Hibernate generated SQL statements on console, what should we do?
39. What are derived properties?
40. Define cascade and inverse option in one-many mapping?
41. Explain about transaction file?
42. Difference between session.save() ,session.saveOrUpdate() and session.persist()?
43. Explain about the id field?
44. What is the use of dynamic-insert and dynamic-update attributes in a class mapping?
45. What is automatic dirty checking?
46. What are Callback interfaces?
47. What is Hibernate proxy?
48. How can Hibernate be configured to access an instance variable directly and not through a setter method ?
49. How can a whole class be mapped as immutable?
50. Explain about transparent persistence of Hibernate?
51. Explain about the dirty checking feature of Hibernate?
52. What is the effect when a transient mapped object is passed onto a Sessions save?
53. Explain about addClass function?
54. Explain about addjar() and addDirectory() methods?
55. What is lazy fetching in Hibernate? With Example .

56. How to Integrate Struts Spring Hibernate ?


57. How to prevent concurrent update in Hibernate?
58. What is version checking in Hibernate ?
59. Explain about the dirty checking feature of Hibernate?
60. What is the effect when a transient mapped object is passed onto a Sessions save?
61. Explain about addClass function?
62.
Features of java
1. Which version of java we are using? and what are the features in 1.5 version and explain them?
2. What is Jvm?
3. Explain features of Java?
4. Garbage Collection ?
Oops concept
1. What is main purpose of oops concept?
2. What is an object-oriented Programming?
3. What is difference between C++ and Java?
4. Explain about OOPs?
5. What are the oops concepts and explain them?
6. What is encapsulation?
7. Encapsulation is keyword or class or interface?
8. What is class and object?
9. Explain about Object class? what are the methods it can have? Tell me about tostring()?
10. What are the methods are available in Object Class?
11. What is inheritance?
12. What is Abstraction ?
13. What is the difference String and StringBuffer and StringBuilder?
Constructors
1. What is constructor and how to initialize an Object?
Inheretence
1. What is super and this keyword?
2. What is function overloading ?
3. What is Marker interface?
Polymorphism
1. Explain about polymorphism?
2. Explain about inheritance and polymorphism in hibernate?
Abstract classes
1. What is an abstraction?
2. What is an Abstract class and interface?
3. Difference between Interface and Abstract Class?
4. What is difference between Abstract class and inner class ?
5. What is the difference between abstract class and interface?
Exception handling
1. What is Exception? Difference between Exception and Error?
2. How many types of Exceptions and explain and given some examples?
3. How we will handle Exceptions?
4. How to write Customized Exceptions?
5. They are given some programs on Try, Catch and Finally?
6. What is final Key word?
7. What is difference between final,finally and finalize() ?
8. what are the types of the exceptions?
9. what is immediate super class of RuntimException?
10. can you write one predefined exception code in real time manner?
11. They can given some programs on Overloading concepts with Exceptions?
Collection frame work
1. What difference LinkedList and ArrayList?

2. What is difference Iterator and Enumeration?


3. can you draw the Collection Hierarchy?
4. What is Difference between list and Set?
5. What is Difference between ArrayList and Vector?
6. How we can sort the elements in HashSet?
7. What is Difference between Comparable and Comparator?
8. What is Difference between Hashmap and HashTable?
9. How we can Synchronize List and set?
10. When we use Enumeration, Iterator and ListIterator?
11. What is collections?
12. What is Iterator?
13. What is the purpose of ArrayList?
14. What is enumeration?
15. What is difference ArrayList and Vector ?
16. What is collections ?
17. What is difference between Abstract class and interface?
18. Differnce between Hashtable VS HashMap?
19. How will you provide thread safety in ArrayList?
20. Vector vs Array list?
21. Explain about collection overview?
22. What is difference b/w HashMap and Hashtable?
23. What is differance b/w ArrayList and Vector?
24. What are methods available in Collection interface?
25. What is difference b/w Arrays and Collections?
Threads
1. Explain about Thread life cycle?
2. What is Difference between Sleep and Wait methods?
3. What is the Difference between Notify and NotifyAll methods?
4. What is Yield method?
5. What is Synchronization?
6. How many ways we are implementing Threads? which ways is better?
7. Can you write multi Threading program?
8. How will you provide thread safety in ArrayList?
9. can you write one multi threading programme?
10. What is serialization? How can you achieve it?where you used in your project?
11. Explain differences between yield() and join() methods ?
12. How many ways are possible to create a Thread ? which way is better?
JDBC questions:
1. write DataSource code?
2. what are drivers available? which driver you use in your project?
3. What are types driver jdbc?
4. What is resource allocator?
Servlet & jsp
1. What is difference between Jsp and Servlet?
2. Is the servlet Thread singleton? explain the reason?
3. Explain about servlet life cycle?
4. Explain about init() method?
5. if we call destroy() from service() what will happen?
6. Differentiate include file Vs include page?
7. Session management techniques?
8. Is it possible to override service() method in Servlet?
9. Explain about Servlets? what are the life cycle methods explain?
10. Among Servlets and JSPs which is better? Where JSP Technology is best suitable.
11. Explain about SingleThreadModel in servlets?
12. Explain about Servlets? what are the life cycle methods explain?
13. Among Servlets and JSPs which is better? Where JSP Technology is best suitable.

14. Tell me about jsp Elements?


15. What is difference b/w scriptlet and declaration?
Spring
1. What is spring?
2. What the difference b/w Spring and Ejb?
3. What are advantage using Spring?
4. What are packages avilable in spring?
5. What is IOC?
6. What is Method injection?
7. What are interfaces available in spring?
8. What is meant by spring?
9. Explain about Spring?
Struts questions
1. what are actions in struts?
2. what is include action?
3. how to declare exceptions in struts?
4. Can we override execute() method in Struts?
5. Explain about struts flow?
6. What are Action classes available in struts?
7. What is DispatchAction? where did you use in your project? where it configure write code?
8. How to write form bean tags in your struts-configuration file?
9. I have 4 action classes i want get second action class how can i get it? where are you configure? can u write
code ?
Hibernate
1. Explain about Hibernate SessionFactory ?
2. Explain about inheritance & polymorphism in hibernate?
3. Explain about Hibernate Architecture ?
4. Explain about Hibernate mappings ?
5. What is meant by component mapping?
6. What are the problems you faced while using hibernate in your
project?
7. Explain about Lazy Loading?
8. Explain differences between get() and load()?
9. What is difference between First level cache and Second level cache?
10. What is the difference Session and SessionFactory?
11. How can we connect more than one database in hibernate applications?
12. Difference between Dialect and Driver?
13. Is it possible to write hibernate application without using hibernate mapping file?
14. Is it possible to write hibernate application without using hibernate configuration file ?
15. Explain about Persistance class life cycle states in hibernate?
16. Explain about hibernate tools?
17. what is hibernate?
18. What is disadvantage using hibernate?
19. What is ORM?
20. Hibernate Assction mappings tell me ? can you give real time examples?
21. what is meant by component mapping?2)what is meant by component mapping?
22. what is meant by inheritance mapping in hibernate?
23. what are the problems you get doing hibernate projects?
24. Explain about Hibernate mappings?
25. Explain about Hibernate Session Factory?
26. Explain about Hibernate Architecture?
27. What is mutable and immutable?
EJB questions
1. what are ejb sessions in ejb?
2. who do you know your ejb application can have stateful or stateless?
3. what is jndi?
4. what is ejb?

Project Manager questions


1. Can you draw your project architecture?
2. What are issues you got in your projects?
3. How can you achieve encapsulation your project?
4. Tell me about your Second project and draw its architectu
5. How to provide security in your Project?and as well as your module also?
6. What are version using in your project?
7. How to handle Exceptions in your project?
8. What is diamond problem in java?
9. What are exception we get doing hibernate in your project?
10 Why we are going to hibernate?
11. What are performance issues you have to faced in your project?
Weblogic server
1. How can you increase connection pool-size in web logic?
Programs
1. Write program in java to check whether the given number is perfect number or not
2. Write Program in java to convert the decimal number to binary number form?
Core Java questions
1. put vs get?
2. what are concepts in 1.5 java?
3. Describe how procedure of c program -like compilation every thing...
4. what is macro write a program to find largest b/w 3 elements by using macro?
5. diff b/w in declaration and definition?
6. tell memory structure allocation process and how it works?
7. what is DMA? what it means?
8. what is function pointer?
9. what is difference b/w structure and union?
10. write a program for conversion of little endian to big endian?
11. what is splay tress and some question about tress?
12. can u write a print a statement with out using print function ?
13. They told me to write a program to find mid point of rectangle by just giving x1 x2 and y1 y2 ?
Misllinious
1. what is Cloning? why we are using Cloning concept? and How many types of cloning?
sir, here i list out some Questions i faced in My Interview.
1) What are the oops concepts and explain them?
2) They can given some programs on Overloading concepts with Exceptions?
3) Difference between Interface and Abstract Class?
4) Which version of java we are using? and what are the features in 1.5 version and explain
5) what is Cloning? why we are using Cloning concept? and How many types of cloning?
6) What is Exception? Difference between Exception and Error?
7) How many types of Exceptions and explain and given some examples?
8) How we will handle Exceptions?
9) How to write Customized Exceptions?
10) They are given some programs on Try, Catch and Finally?
11) Explain about Thread life cycle?
12) What is Difference between Sleep and Wait methods?
13) What is the Difference between Notify and NotifyAll methods?
14) What is Yield method?
15) What is Synchronization?
16) can you draw the Collection Hierarchy?
17) What is Difference between list and Set?
18) What is Difference between ArrayList and Vector?
19) How we can sort the elements in HashSet?
20) What is Difference between Comparable and Comparator?
21) What is Difference between Hashmap and HashTable?
22) How we can Synchronize List and set?

23) When we use Enumeration, Iterator and ListIterator?


24) What is the difference String and StringBuffer and StringBuilder?
25) what are the methods are available in Object Class?
After these they come to the Advanced Java(Jdbc, Servlets, jsp)
1) How many Drivers are there in Jdbc? Which Driver we are using in our project?
2) Can you write the code for Connecting the database?
3) What is Connection pooling mechanism? How we can implement?
4) Difference between Statement and PreparedStatement?
5) What is Callable Statement?
6) What is Servlet Life Cycle?
7) If iam sending the request at in servlet life cycle which method will be called?
8) What is the difference between Forward and include Mechanisms?
9) What is the difference between Forward and SendRedirect Mechanisms?
10) What is the difference between Servlet Config and servlet Context?
11) What are the Implicit objects in jsp?
12) How we can Handle the Exceptions in Jsp?
13) What are the scopes in jsp?
While coming to Struts
1) Explain Struts Flow?
2) What is I18N?
3) What are the Actions are available in Struts?
4) What is the difference between DispatchAction and LookupDispatchAction?
5) What is Switchaction?
6) What is MVC?
7) Struts follows which MVC Architecture?
8) What is FrontContoller?
9) What is Singleton Design Pattern? can you write some code about this?
10) What is DAO and Explain?
11) Which Tags are there in Struts-config.xml file?
12) Difference between Struts1.2 and Struts2.0?
13) How you provide the validations?
While Coming to PROJECT MANAGER ROUND
1) Explain about your project?
2) How many Modules are there in your project?
3) What's your Role and Responsibilities?
4) How big is your Team Size?
5) Tell me Some Exceptions you faced in your project?
6) Which type of Complexity code you written in your project
7) Which Version Controller you used?
8) Which type of validations you done in your Project?
Etc.
Once again I Thanks to Durga sir, Nagoor Babu Sir and Ravindra Sir.
Your's N.Venkatesh.
1. Explain features of Java?
2. Explain about polymorphism?
3. What is the purpose of ArrayList?
4. Explain about Hibernate Session Factory?
5. Explain about inheritance and polymorphism in hibernate?
6. Explain about Hibernate Architecture?
7. What is mutable and immutable?
8. What are performance issues you have to faced in your project?
HCL - Hibernate Interview Questions by Mr.Nagaraju (27-3-2010) with 3+ years Java Experience.
1. Explain about Hibernate SessionFactory ?
2. Explain about inheritance & polymorphism in hibernate?
3. Explain about Hibernate Architecture ?
4. Explain about Hibernate mappings ?

5. What is meant by component mapping?


6. What are the problems you faced while using hibernate in your project?
7. Explain about Lazy Loading?
8. Explain differences between get() and load()?
9. What is difference between First level cache and Second level cache?
10. What is the difference Session and SessionFactory?
11. How can we connect more than one database in hibernate applications?
12. Difference between Dialect and Driver?
13. Is it possible to write hibernate application without using hibernate mapping file?
14. Is it possible to write hibernate application without using hibernate configuration file?
15. Explain about Persistance class life cycle states in hibernate?
16. Explain about hibernate tools?
17. what is hibernate?
18. What is disadvantage using hibernate?
19. What is ORM?
IBM Interview Questions by Mr.Nagaraju with3+yearsJava Experience
Technical questions:
1)What is Spring?
2)What the difference b/w Spring and Ejb?
3)What are advantage using Spring?
4)How many ways we are implementing Threads? which ways is better?
5)What is difference between Jsp and Servlet?
6)Is the servlet Thread singleton? explain the reason?
7)Can you write multi Threading program?
8)What are packages avilable in spring?
Project Manager round:
1)How to provide security in your Project? and as well as your module also?
2)What are version using in your project?
3)How to handle Exceptions in your project?
4)What is diamond problem in java
5)What are exception we get doing hibernate in your project?
6)Why we are going to hibernate?
ITC Interview Questions by Mr.Nagaraju with 3+ years Java Experience
Core Java questions:
1. What is the difference between abstract class and interface?
2. Explain about OOPs?
3. Differnce between Hashtable VS HashMap?
4. How will you provide thread safety in ArrayList?
5. Explain about Object class? what are the methods it can have? tell me about tostring()?
6. what are the types of the exceptions?
7. what is immediate super class of RuntimException?
8. can you write one predefined exception code in real time manner?
9. put vs get?
10. Vector vs Array list?
11. what are concepts in 1.5 java?
12. can you write one multi threading programme?
JDBC questions:
1. write DataSource code?
2. what are drivers available? which driver you use in your project?
Servlets question
1. Explain about servlet life cycle?
2. Explain about init() method?
3. if we call destroy() from service() what will happen?
4. Differentiate include file Vs include page?
5. Session management techniques?
Spring questions:

1)What is IOC?
2)What is Method injection?
3)What are interfaces available in spring?
4)What is meant by spring?
EJB questions:
1)what are ejb sessions in ejb?
2)who do you know your ejb application can have stateful or stateless?
3)what is jndi?
4)what is ejb?
Hibernate questions:
1)Hibernate Assction mappings tell me ? can you give real time examples?
2)what is meant by component mapping?2)what is meant by component mapping?
3)what is meant by inheritance mapping in hibernate?
4)what are the problems you get doing hibernate projects?
Struts questions:
1)what are actions in struts?
2)what is include action?
3)how to declare exceptions in struts?
Project Manager questions:
1)Can you draw your project architecture?
2)What are issues you got in your projects?
SOCIETE GENERALE Interview Questions by Mr.Nagaraju(20-3-2010) with 3+ years Java Experiance
1. Is it possible to override service() method in Servlet?
2. Can we override execute() method in Struts?
3. Explain about Hibernate mappings?
4. How can you increase connection pool-size in web logic?
5. Explain differences between yield() and join() methods ?
T C S Interview Questions by Mr.Nagaraju (27-3-2010) with 3+ years Java Experience.
1. Tell me about your Second project and draw its architecture?
2. Explain about Oops?
3. Encapsulation is keyword or class or interface?
4. How many ways are possible to create a Thread ? which way is better?
5. Explain about Servlets? what are the life cycle methods explain?
6. Among Servlets and JSPs which is better? Where JSP Technology is best suitable.
7. Tell me about jsp Elements?
8. What is difference b/w scriptlet and declaration?
9. Explain about struts flow?
10. What are Action classes available in struts?
11. What is DispatchAction? where did you use in your project? where it configure write code?
12. How to write form bean tags in your struts-configuration file?
13. I have 4 action classes i want get second action class how can i get it? where are you configure? can u write
code ?
14. Explain about SingleThreadModel in servlets?
15. Explain about collection overview?
16. What is difference b/w HashMap and Hashtable?
17. What is differance b/w ArrayList and Vector?
18. What are methods available in Collection interface?
19. What is serialization? How can you achieve it?where you used in your project?
20. What is Marker interface?
21. How can you achieve encapsulation your project?
22. Explain about Spring?
23. What is difference b/w Arrays and Collections?
Virtusa Interview Questions by Mr.Nagaraju (27-3-2010) with 3+ years Java Experience.
1. What is the Hibernate? What are files we have requires doing a hibernate application?
2. Explain about Hibernate Architecture?

3. Explain your project flow? What technologies used in your previous project?
4. Explain about Spring Framework features?
5. How do you configure using spring mvc with DAO class?
6. What is Abstraction, inheritance polymorphism?
7. What are Checked vs Unchecked Exceptions?
8. What is AutoBoxing and AutoUnboxing ? Can you Explain with real time example?
9. Explain differences between Abstract class vs interface?
10. Explain differences between HashMap and Hashtable?
11. try{ some code }
catch(Exception e) { some code }
finally{ some code }
which one is optional?
12. try{ some code; system.exit(0); }
Catch(Exception e){ Some code }
finally{ some code }
what will happen?
13. What is the difference b/w extends Thread class and implements Runnable interface?
14. Explain about Servlet life cycle ?
15. How to include one jsp into anther jsp? Which tag we can use for this purpose ?
16. Explain about Struts?
17. Explain Singleton Design pattern?
18. How to connect more than one database in Hibernate?
19. I want change my database from Oracle to MySQL in hibernate. Which configuration changes are required
and which classes we have to use?
20. Which tools you used in project?
21. What are version control tools used in your project? Explain about check-in and check-out?
22. What is your team size?
23. How to build modules in your project? Are you used any tool for this?
24. What is Sax parser and Dom parser?
Mahaboob Basha Interview experience@Virtusa with 2+ years experience
Dear Durga Sir,
This is Mahaboob Basha, I attended scjp and scwcd classes. I got the offer in Virtusa
on 25th Oct, 2010. So
I Really Thanks to Durga sir and Nagoor Babu Sir. based on your guidence i got this offer and in IBM also.
Interview Process in Virtusa is ....
First they conducted the Written Test Round after that Technical Round after they
conducted Project
Manager Round, after they conducted HR Round.
About the Written Test
In written test they gave the question paper consisting of 20 questions in which about 10-12questions are on
core java. 2-3 questions on servlets and 2-3questions on jsps and
1-2 questions on struts and 1question on spring.
In this round I got around 19marks and
16 marks is the cut off. And I could remember some of the questions
1. A Thread object has a method called notify(). (true/false)
2. Which kind of ActionForm doesn't need to implement setter and getter methods by developer?
3. In Struts, which of the following best maps to the "front controller"?
4. One question on Hash Map
5. One question on Hash Set
6. Around 3-4 questions on programs of core java which are very easy.
7. one question on the directory structure of jar file.
About my Technical Round.........
In technical Round the interviewer took me the interview for 2hours first he asked to
me first tell me about myself and after that he asked me about the project and then he
started to ask me
questions on Core Java.If we are very good at in core java then they
asked simple questions on J2EE.And then he
will ask only Struts Flow in struts.If we are
average in core java on that time they asked some what difficult
questions on J2EE.So
they mainly Concentration on Core Java.
sir, here i list out some Questions i faced in My Interview.
1.What are the oops concepts and explain them?
2.What is mean by Polymorphism and what is the difference between static and dynamic polymorphism?

3.They he asked about the overriding and method hiding?


4.What is mean by singleton class and can u write a program?
5.Difference between Interface and Abstract Class and where did u used interface in your project?
6.Which version of java we are using in your project? and what are the features in 1.5 version?
7.What is Exception? Difference between Exception and Error?
8.What is mean by checked and unchecked Exceptions?
9.He asked me about Try, Catch and Finally and he asked different control flow of try..catch,try..catchfinally
type questions?
10.Difference between final,finally,finalize?
11.Explain about Thread life cycle?
12.What is the Difference between Notify and NotifyAll methods?
13.What is Synchronization?
14.What is mean by collection frame work and explain the complete hierarchy?
15.What is difference between Array List and Vector?
16.In ur project where did u used the Array List?
17.Differnce between Comparator and comparable?
18.Difference between Hash Map and Hashtable?
19.Can u explain about the Stack?
20.Can u tell me something about the collections?
21.Tell me something about Enumeration, Iterator and list Iterator?
22.What is the difference String and StringBuffer and StringBuilder?
23.What is mean by immutability?
After these he come to the J2EE
1) Can you write the code for Connecting the database using JDBC?
2) What is Connection pooling mechanism? How we can implement?
3) Difference between Statement and PreparedStatement?
4) What is Callable Statement and can u write program for that?
5) What is Servlet Life Cycle?
6) What is the difference between Forward and include Mechanisms?
7) What is the difference between Forward and SendRedirect Mechanisms?
8) What is the difference between Servlet Config and servlet Context?
9) What are the Implicit objects in jsp?
10) How we can Handle the Exceptions in Jsp?
11) What are the scopes in jsp ?
While coming to Struts
1) Explain Struts Flow?
2) What are the features of struts 1.3.x version?
3) What are the Actions are available in Struts?
4) What is the difference between DispatchAction and LookupDispatchAction?
5) What is Switchaction and where did used in your project?
6) What are the parameters used in the ActionForward execute()?
7) What is Singleton Design Pattern? can you write some code about this?
8) Which Tags are there in Struts-config.xml file?
9) Can explain about the validations and in your project where did u used the validations?
While Coming to PROJECT MANAGER ROUND
1) Explain about your project?
2) How many Modules are there in your project?
3) What's your Role and Responsibilities?
4) How big is your Team Size?
5) Tell me Some Exceptions you faced in your project?
6) Which type of Complexity code you written in your project
7) Which type of validations you done in your Project?
8) Have you helped your team member in your project?
9) If anything dispute arises between your college and you then how will u handle that?
10) If anything dispute arises in your work and personal work then how will u handle it?
While Coming to Hr Round

1.Can u tell about yourself and your experience?


2.What is the package you are excepted?
3.Whats your strength and weakness?
4.When will u join the company?
Once again I Sincerely Thanks to Durga sir, Nagoor Babu Sir
Date:9-9-2014
TCS 2+years very good Java interview quetions
================:=======================:1)What is difference between abstraction and encapsulation ?
2)how ways to acheive abstraction in java ?
3)why interface ,eventhough we have abstract class ?
4) Why wait() ,notify() and notifyAll() methods are in Object class instead of Thread class?
5)explain exception structure ?
6)we can implement try block with out catch?
7)can we stop finally block execution ?
8)what happends if return statement place in exception handling?
9)What is the difference between String and StrinBuffer ?
10)String s="abc"
s="xyz" then whats the value of s?
11)String s="xyz"
s1="xyz" how many objects created ?
12)String s="abc"
String s1=new String("abc"); how many objects created ?
13)What is immutable ?
14)What is the difference between Collection And Collections ?
15)Expalain Collection heirarchy ?
16)why List,Set,Map ?
17)What is Comparable,Comparator?
18)Expain methods of Comparable and Comparators?
19)class Employee{
HashSet hs=new HashSet();
hs.add(new Employee().setName("ramesh");
hs.add(new Employee().setName("ramesh");
} how many Employee objects Set contains ?
20)How you can create SessionFactory object in your project ?
21)Expain transaction in hibernate ?
22)how you can map list in mapping file?
23)expain one to many mapping in hibernate ?
24) how to call procedures in hibernate ?
25)how to integrate hibernate with Spring ?
26)how to integrate Struts with Hibenate ?
27)expain HibernateTemplate ?
28)in hibernate we have SessionFactory,Session,Transaction etc.....like that in strut2 have any thing ?
29)How many modules you know in Springs ?
30)why Spring ?
31)what is the difference between load() of JS and ready() method of Jquery ?
30)how you can disable some text in JS ?
31)why HQL , Criteria ?
32)How Map works ?
33)What is Serialization? why serialization ?how you can use it ?
34)What is marker interface ,why marker interface ?give me some Examples ?
35)Difference between ServletContext and ServletConfig ?
36)What are implicit objects in JSP ?
37)tell me something about your current project ?
Phonex It Solutions:
1. Wt is diff b/w JDBC and Hibernate

2. Wt is ActionServlet
3. How to integrate struts and spring
4. How to handle exceptions
5. Which jdbc driver u r using ? why?
6. What is log4j and its main advantage?
7. What is ur version control and advantages
8. In eclipse how to establish link source files to classes folder
9. What will happen if u compile jsp program where it is stored?
10. What is web.xml and use of it?
11. What r joins and explain?
12. What is framework ? why?
13. What is ur project architecture?
Broadridge :
1. what is IOC?
2. Write MVC and explain
3. What is ant? Write a ant scripting to load required jars automatically at runtime, whenever the system has
less memory to store all files?
4. What are joins?
5. Write a trigger, procedure
6. What is AOP
7. What is Aspect
Dell
1. What is MVC arch
2. Write update query to update all employee sal 10% increase
3. What is javabean why
4. What is controller why
5. What is front design of ur project?
6. Explain p.s.v.main(String arg[]) why static?
7. Class program
8. {
Static void m()
{
sop(m)
}
Void m()
sop(m1)
}
}
Class mypro
{
Psvm()
{
m();
}
}what happen?
GSS Infotech Solutions
1. We have collection object type string, how to retrieve in jsp program
2. Can u create object for system class?
3. Tell jsp tags
4. Is sugestable java code in jsp
5. Explain about validator framework
IBM, Bang (18-08-2012) F2F
1. How to perform unit testing?
2. How to move your developed files to testing dept
3. What is main advantage of log4j

4. Servlet object creation


5. What are implicit object and their datatypes
6. We are not extending String class from our class why? (String s= something)
7. If we implement polymorphism then inheritance is defeault: true or false
8. What are return types of sql quaries
9. What are interfaces of collections
Tavant Technologies(1-09-12)
1. Write a program that has List obj, StudentList<Student> , it contains id,name,marks,status[pass,fail] now I
want student list who are passed
2. Explain validations in struts
3. Write a criteria query that has two pojo classes,Student and Subject now query for students who are
associated with maths subject
Open Symphony pune(24-09-12)Tel
1. Diff between interfaces and abstract classes
2. How to initialize serializable classes
3. Diff between static and non static
4. Can we use static serialization
5. Explain method overloading and overriding
Find output:
Class base{
Public void m(Object o){sop(base);}
}
Class derived extends base{
Public void m(String s){soop(derived);}
}
Public static void main(String arg[]){
Base b = new derived();
b.m(new String);
b.m(new HashMap);}
1. How to debugging in eclipse
2. Diff between servlet and jsp
3. What happen in jsp compilation
4. What is httpsession
5. Diff between generic servlet and httpservlet
6. What are scriptlets in jsp and wt is problem and wt is alternative
7. What is method for sorting
8. Can we synchronized an arraylist object
9. How to compare employee objets
10. Diff between comparable and comparator
11. How to reverse the collection objects
Skype video conference with above company
1. Is arraylist inserted orderd? Hashmap?
2. In jsp how to propagate error messages
3. Web.xml
4. Sql queries
5. Explain about ant, maven, jquery,javascript
6. Which version controller ur using
7. Method orriding
Infinite Computer sol(22-09-12) Tel
1. How to use serialization concept in ur project ? if not used what happened?
2. How to integration done ur project
3. How to initialize ur hibernate dao related classes.
4. Log4j main use and assertions
5. Expections
Interview Questions Syntel, IBM Telephonic
6. Why Java as OOP language?

7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.

Main difference between C++ and Java?


Inheritance types with real time examples?
Polymarphim real time example?
Abstract class and Interface .. ect
How config Hibernate?
Difference between SQL and HSQL?
Collections and Collection?
Hsahmap and Hash table?
Collections hierarchy?
Servlet life cycle?
JSP life cycle?
How to connect DB by using MySQL?
Struts Flow?
One jsp, One Servlet, One pojo - how to define directory structure?
What is prepared statement, and advantage of that?
What are the different between java 1.4, Java 1.5 and Java 1.6?
What is the main difference between core java and advance java?
What is the difference between JVM, JDK, JRE?
How to use JUNIT in your project?
Why web.xml?
What are the problems faced in the current working project?
Abstract design pattern code?
Object class methods?
What are the features of JDBC 2.0 and JDBC 3.0?
You performed any java testing? Is needed?
Explain about MVC design pattern?
What are the core classes of your project?
Explain about hibernate mapping xml file?
Struts flow in your current project?
What is your job in Design Phase?
Chennai
1)explain your current project?
2)how to configure lazy loding?
3)wher you are using collections in your project?
4)can you chang the arraylist values? how can you change?
5)explain MVC architecture?
6)where your using hibernate in your project?
7)what is struts actionclass explain?
8)explain exception and error?
9)which type of exceptions handle in your project?
10)explain stack overflow and heap?
11)which type of exceptions rised in your project?
1)can we extend string class?
2)what is an abstract class?
3)can we write two constructors in abstract?
4)one to one relationship in hibernate how to write lazy loding in hibernate?
5)write a program string by word with out using stringTokenizer?
6)what is the use of flush() method in Hibernate?
7)what is evit() method and expalain them?
8)what is the diff b/w abstract and interface?
9)what is use of final&finalize?
1)write a program to print the given String is pallindrom or not?
2)write a program the given String is Sorting order in Desinding?
3)write a program to print the FibnoicSeries?
4)write a program String s="this,is,an,have,work,to,the,home";count the no of commas?
5)write a program on userdefined exceptions or custom exceptions?

6)write a program to print given no is prime or not?


7)What is First and Second Level caching in Hibernate?
First-level cache always Associates with the Session object.
Hibernate uses this cache by default. Here, it processes one transaction after another one,
means wont process one transaction many times. Mainly it reduces the number of SQL queries it needs to
generate within a given transaction. That is instead of updating after every modification done in the
transaction,
it updates the transaction only at the end of the transaction.
1.2) Second-level cache
Second-level cache always associates with the Session Factory object. While running the transactions, in
between it loads the objects at the Session Factory level,
so that those objects will available to the entire application, dont bounds to single user.
Since the objects are already loaded in the cache, whenever an object is returned by the query,
at that time no need to go for a database transaction.
In this way the second level cache works. Here we can use query level cache also. Later we will discuss
about it.
1)what is map?
a)A Map is an object that maps keys to values. A map cannot contain duplicate keys:
Each key can map to at most one value.
It models the mathematical function abstraction. The Map interface follows.
2)what is connection pooling?
a)It's a technique to allow multiple clinets to make use of a cached set
of shared and reusable connection objects providing access to a database.
Connection Pooling feature is supported only on J2SDK 1.4 and later releases.
3)what is iterator how to use hashmap?
4)what is lazyloding()
5)what is diapatchaction?
6)what is garbagecollection?
a)When a Java object becomes unreachable to the program, then
it is subjected to garbage collection. The main use of
garbage collection is to identify and discard objects that
are no longer needed by a program so that their resources
can be reclaimed and reused.
7)what is jvm?
a)JVM is the main component of Java architecture and it is the part of
the JRE (Java Runtime Enviroment) . It provides the cross platform functionality to java.
This is a software process that converts the compiled Java byte code to machine code.
8)what is context?
a)public interface Context
This interface represents a naming context, which consists of a set of name-to-object bindings.
It contains methods for examining and updating these bindings.
Names
1)write a sample code in customexceptions?
a) import java.io.*;
// A Java application to demonstrate making your own Exception class
// This program catches the exception when the word "client" is
// entered incorrectly.
public class TestException
{
static String s = "";
//-------------------------------------------------------public static void main (String args[])
{
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader buf = new BufferedReader(is);
System.out.println("Enter the word you cannot spell: ");

try
{
s = buf.readLine();
}
catch (IOException e)
{
System.out.println("IOException was " + e.getMessage());
}
try
{
checkSpelling(); // this method throws SpellException
}
catch (SpellException se) // but it is caught here
{
System.out.println("Spell exception was: " + se.getError());
}
} // end main
//---------------------------------------------------------// Check spelling of typed in word. Throw exception if wrong.
// Note how this method specifies that it throws such and such
// exception. Does not have to be caught here.
private static void checkSpelling() throws SpellException
{
if (s.equalsIgnoreCase("client"))
System.out.println("OK");
else
throw new SpellException("Cannot spell client");
}
} // end main class
//***********************************************
// Custom exception class that descends from Java's Exception class.
class SpellException extends Exception
{
String mistake;
//---------------------------------------------// Default constructor - initializes instance variable to unknown
public SpellException()
{
super();
// call superclass constructor
mistake = "unknown";
}
//----------------------------------------------// Constructor receives some kind of message that is saved in an instance variable.
public SpellException(String err)
{
super(err); // call super class constructor
mistake = err; // save message
}
//-----------------------------------------------// public method, callable by exception catcher. It returns the error message.
public String getError()
{
return mistake;
}
}

2)using arrylist add values and copy that values in to map?


3)What are the methods in Object class?
a)There are lots of methods in object class.
the list of some methods are asclone
equals
wait
finalize
getClass
hashCode
notify
notifyAll
toString.
/*
Reverse string by word using StringTokenizer example.
This example shows how to reverse a line or sentense using Java StringTokenizer and String classes.
*/
import java.util.StringTokenizer;
public class ReverseLine {
public static void main(String[] args) {
String strLine = "Java Reverse string by word example";
//specify delimiter as " " space
StringTokenizer st = new StringTokenizer(strLine, " ");
String strReversedLine = "";
while(st.hasMoreTokens())
{
strReversedLine = st.nextToken() + " " + strReversedLine;
}
System.out.println("Reversed string by word is : " + strReversedLine);
}
}
/*
Output would be
Reversed string by word is : example word by string Reverse Java
*/
--------------------------------------------------------------------------------------------------------------------------------------------------------/*
Java StringTokenizer count tokens example
This example shows how to count remaining tokens of java StringTokenizer object
using countTokens() method.
*/
import java.util.StringTokenizer;
public class StringTokenizerCountTokensExample {
public static void main(String[] args) {
//create StringTokenizer object
StringTokenizer st = new StringTokenizer("Java StringTokenizer count Tokens Example");
/*
countTokens() method returns the number of tokens remaining from the current
delimiter set.
It calculates the number of times StringTokenizer's nextToken() method
can be called before it generates an exception.
Please note that invoking countTokens() method does not advance the
current position.
*/
//iterate through tokens

while(st.hasMoreTokens()){
System.out.println("Remaining Tokens : " + st.countTokens());
System.out.println(st.nextToken());
}
}
}
/*
Output Would be
Remaining Tokens : 5
Java
Remaining Tokens : 4
StringTokenizer
Remaining Tokens : 3
count
Remaining Tokens : 2
Tokens
Remaining Tokens : 1
Example
*/
Reversing a String by Word
String test = "Reverse this string";
Stack stack = new Stack();
StringTokenizer strTok = new StringTokenizer(test);
while(strTok.hasMoreTokens()) {
stack.push(strTok.nextElement());
}
StringBuffer revStr = new StringBuffer();
while(!stack.empty()) {
revStr.append(stack.pop());
revStr.append(" ");
}
System.out.println("Original string: " + test);
System.out.println("\nReversed string: " + revStr);
The output of this code fragment will be
Original string: Reverse this string
Reversed string: string this Reverse
5)write a program on userdefined exceptions or custom exceptions?
package na;
public class Nage extends Exception
{
public Nage(String s)
{
super(s);
}
}
-->
package ap;
impoer na.Nage;
public class Age
{
public void decide(String s0throws NumberFormatException,Nage
{
int age=Integer.parseInt(s);
if(age<=0)

{
Nage na=new Nage("U HAV ENTERED INVALID AGE..!");
throw(na);
}
else
{
System.out.println("ok, u hav entered valid age...!");
}
}
}
import na.Nage;
import ap.Age;
class CDemo
{
public static void main(String[]args)
{
try
{
String s1=args[0];
ap.Age Ao=new ap.Age();
Ao.decide(s1);
}
cache(Nage na)
{
System.out.println(na);
}
catche(NumberFormatException nfe)
{
System.out.pritln("PASS ONLY INTEGER VALUES...!");
}
catche(ArithmeticException ae)
{
System.out.println("PASS INTEGER VALUES ONLY...!");
}
catch(ArrayIndexOutofBoundsException aioobe)
{
System.out.println("PASS VALUES THROUGH COMMAND PROMPT...!");
}
catch(Exception e)
{
System.out.println(e);
}
}
}
write a program to print the given String is pallindrom or not?
import java.util.*;
public class CheckPalindrome{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.print("Enter String: ");
String st=input.next();
String str[]=st.split("");
String reversedSt="";
for(int i=str.length-1;i>=0;i--){
reversedSt+=str[i];

}
if(st.equalsIgnoreCase(reversedSt)){
System.out.println("String is palindrome");
}
else{
System.out.println("String is not palindrome");
}
}
}
write a program to print the FibnoicSeries?
import java.util.*;
public class Fibonacci{
public static int fibonacciSeries(int n) {
if (n == 1)
return 1;
else if (n == 2)
return 1;
else
return fibonacciSeries(n-1) + fibonacciSeries(n-2);
}
public static void main(String[] args) throws Exception {
Scanner input=new Scanner(System.in);
System.out.print("Enter value of n: ");
int num = input.nextInt();
for(int i=1;i<=num;i++){
System.out.println(fibonacciSeries(i));
}
}
}
import java.util.*;
class SortList
{
public static void main(String[] args)
{ Scanner input=new Scanner(System.in);
ArrayList<String> list=new ArrayList<String>();
System.out.println("Enter names of 5 Cricketers: ");
for(int i=0;i<5;i++){
String name=input.nextLine();
list.add(name);
}
System.out.println("Names of 5 Cricketers in sorted order: ");
Collections.sort(list);
for(int i=0;i<list.size();i++){
System.out.println(list.get(i).toString());
}
}
}
import java.util.*;
public class ReverseString{
public static String reverse(String st){
String rev = new StringBuffer(st).reverse().toString();
return rev;
}
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.println("Enter string: ");

String str=input.nextLine();
System.out.println("Reverse: " + reverse(str));
}
}
import java.util.*;
class Factorial{
public static int findFactorial(int n)
{
if (n == 1) {
return n;
}
else {
return n * findFactorial(n - 1);
}
}
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.print("Enter number: ");
int num=input.nextInt();
System.out.println("The factorial of " +num+" is : " + findFactorial(num));
}
}
Java Custom Exception Sample Code
package com.myjava.exceptions;
public class MyOwnException {
public static void main(String[] a){
try{
MyOwnException.myTest(null);
} catch(MyAppException mae){
System.out.println("Inside catch block: "+mae.getMessage());
}
}
static void myTest(String str) throws MyAppException{
if(str == null){
throw new MyAppException("String val is null");
}
}
}
write a sample code in customexceptions?
class MyAppException extends Exception {
private String message = null;
public MyAppException() {
super();
}
public MyAppException(String message) {
super(message);
this.message = message;
}
public MyAppException(Throwable cause) {
super(cause);
}
@Override
public String toString() {
return message;

}
@Override
public String getMessage() {
return message;
}
}
Example Output
Inside catch block: String val is null
Winfo ware technologies.
Hr Executive : Anuradha
Round - 1:
Technical interview.
General
1. Current Working profile.
2. Roles & Responsibilities.
3. Architecture. Of Project
4. Application of project to the architecture.
OOPS
10. Abstraction, Abstract classes.
11. Encapsulation.
12. Inheritance (Multiple)
Data Bases
13. Joins. (Types, explain)
tbl_employee

Eid

Name

Raju

2.

Rajiv

3.

Rajesh

4.

Ravi

5.

Ramu

tbl_salary

Id

Month

Salary

1.

January

1000

2.

February

2000

3.

March

3000

4.

April

4000

Select All Employee Names, Month, Salary

Select All Employee Names, Month, Salary of February month.


Trigent Software solutions.
Hr Executive : Sumathi
Round - 1:
Technical test.
Programming
1. Write a method for extracting last n characters from a string & returning them in reverse order.
eg: string 12548796254
if we want to extract last 4 characters, O/P should be 4526.
If we want to extract last 5 characters, O/P should be 54269.
2. Write logic to display elements of an array in reverse order.
eg: array [] = {15, 20, 36, 47, 91}
O/P should be:{51, 02, 63, 74, 19}
CENDUIT INDIA Services.
Hr Executive : I for got her name.
Round - 1:Technical interview.
General
1. Briefly introduce yourself.
2. Main Roles & Responsibilities in current company.
3. Have you faced any particular challenges in current Project?
Data Bases
4. DML? DDL? (difference)
5. What do we use to get data without repetition?
6. Union (Concept)?
7. Delete Truncate (difference)
Is delete DML / DDL?
Is truncate DML / DDL?
General
8. Are you looking for job change?
VENSOFT TECHNOLOGIES INDIA PVT LTD.
Hr Executive : Kiran.
Technical person : Venkat
Round-1: Technical interview
Questions:
General
1. Tell me about yourself briefly.
2. Your Roles & Responsibilities in current company.
3. Explain your current project briefly.
OOPS
4. Architecture used in current project.
5. Application of architecture to current project.
6. OOPS concepts used in your project.
7. Abstractio? Explain with an example.
8. What are Delegates? & interfaces?
Data Bases
No questions asked in data bases.
Adi tech pvt ltd.
Hr Executive :
Questions:Telephonic interview (14:30 hrs).
General
1. Briefly introduce yourself.
2. Roles & Responsibilities in current company.
3. Project? (explain briefly).
Asp.net, OOPS, Web Technologies
4. Do you have idea about HTML?
5. How much do you rate yourself in HTML on a scale of 10?

6. Do you know JAVA SCRIPT & AJAX?


7. Why Ajax is used?
8. What is JQuery?
Data Bases
No Questions asked in this topic.
EMIDS TECHNOLOGIES.
Hr Executive : Shruti.
Refered by : I net frame consulting.
Round-1: System test.
Programs
Accept a string in a text box. Display output of bellow tasks in a label.
Task-1: Count number of vowels in a string.
Task-2: Count number of dates entered in a string.
Task-3: Accept two dates, Date1 in (dd/mm/yyyy) format & Date2 in (mm/dd/yyyy) format.
Compare those two dates & display if those two dates are same or not.
CHIMERA Technologies Services.
Hr Executive : Arpita.
Technical Person: Prakash.
Round-1: General interview.
General
1. Where are you currently working?
2. Your current Project? Explain briefly?
3. Previous company?
4. Previous company projects? Explain briefly?
5. Total experience?
6. Relevant experience?
7. Notice period?
8. You said notice period as 1 week, will company people agree with it?
9. Why are you looking for job change?
Round-2:Technical interview
General
1. Your role in current company?
2. What are all technologies used in current project.
3. Team size?
Asp.net, OOPS, Java Script, CSS, AJAX, Ado.net
4. How do you manage your code?
5. Can we create user control dynamically in a web page?
6. I have grid view in a web page displaying some data according to some criteria.
If I give wrong search criteria, I need to display empty grid view/ How?
7. How do we find a control in a web page?
8. How do you find a control in a web page using JAVA SCRIPT?
9. What is the command in Java Script to display popup window?
10. What is CSS?
11. Different means of implementing CSS?
12. Different kinds of accessing inline classes?
13. What are the components used to retrieve data (from data bases)?
14. I have one dataset (dst1) with some data in it. I take another data set (dst2) with no data in it. How to copy data
in dst1 to dst2?
15. I have one dataset with 10 tables in it. How to delete table at 8th position?
16. What are content pages?
17. How many number of content pages can we have in a project?
18. How many web.config files can we have in an application?
Data Bases
19. How can we bypass the code in a stored procedure?
20. Difference between Hash table & temp table?
Asp.net

21. Have you heard about .net nuke?


22. How do you implement web services into your application?
23. Do you have knowledge of web services?
24. Do you have knowledge of SSRS?
EMIDS Technologies Pvt Ltd.
Hr Executive : Shruti.
Technical Person: forgot his name.
Please refer interview7.doc file for the Round 1.
Round-2:Technical interview.
Asp.net, OOPS, Ado.net
1. What is Asp.net?
2. What tasks did you perform in current company?
3. Architecture of Asp.net?
4. Where dose memory management takes place in Asp.net Architecture?
5. What are HTML Components?
6.

Drop down list.


Country :

State

The above is a sample web page.


Write code to display data in grid view according to Country & state selected. (Code from stored procedures to
events)
7. Use OOPS Concepts to write class code in above example?
8. Using Inheritance how do you implement above functionality in classes (UML Diagrams)?
9. What is polymorphism?
10. What is runtime polymorphism?
11. How do you implement runtime polymorphism?
12. What is abstraction?
13. What is View state?
14. How do you preserve data in a page with out using View state (enabling view state as false)?
15. How do you set view state as false for the entire web page?
16. Components used to retrieve data from data base to web page?
17. In task given in question 6, what do we use to store data to be displayed in grid view?
18. In task given in question 6, if we need to display only 10 records per page, How do you display only 10 records
in grid view (with out setting no. of records property of gird view as 10)?
19. Which Ado.net component do you prefer when small amount of data is to be retrieved from data base?
Data Bases
20. What tasks have you preformed in (sql server) in the project?
21. What are joins?
22. What are views?
23. Why do we use views?
24. Can you explain normalization concept?
25. What is primary key?
26. Why do we use primary key?
27. What are elementary keys?
28. What is hash table?
29. What is transaction?

30. Why do we use transactions?


Round-3:Technical interview
General
1. Brief about yourself?
2. ((a+b)>c), write generic class to store above expression.
3. Order of evaluation of above expression?
4. What are the challenges faced by you till now?
5. Your Aspirations?
6. Any questions to ask?
EMIDS Technologies Pvt Ltd.
Hr Executive : Megha.
Technical Person: Anupama.
Please refer interview7.doc file for the Round 1.
Please refer interview9.doc file for the Rounds 2, 3.
Round-4:Technical interview.
General
1. Brief about yourself?
2. What kind of applications have you developed?
3. Would you like to work in different technology?
4. Can you explain any example (Web page / Module) in your current project?
Data Bases
5. Have you created data base tables for web forms using SQL SERVER?
6. Can you explain what kind of tables have you developed in current project?
7. What are the challenges faced by you in your software career?
8.

Text area
Doctor complaints:

Disease

The above is a sample web page (Visit details).


If I want to add some functionality to the above page, How can you implement the changes & How could you design
tables for additional functionality?
Round-5:HR Round.
1. Brief about yourself?
2. What are the challenges faced by you in your career?
3. Why do you look for job change?
4. Are you willing to work in different technologies?
5. Have you attended any other interviews (Have you got any other offers)?
6. Are there any constraints for you to work in this company?
7. What is your current CTC?
8. How much do you expect?
9. Any questions to ask?
Round-6: General discussion with Megha, hr executive.
1. Do you have any other offers?
2. What is your current CTC?
3. How much do you expect?
4. Ok, Harish, Congratulations!! you got selected for the position of Software Engineer in this company, any
constraints for you to work in this company?

5. When could you join?


6. And company is offering you more than what you have expected, Are you ok with this company to work?
7. Could you join by next Monday, August 08th, 2011 with all the required documents?
1) Servlets,Servlet Filters,Listners.
2) Jsp, Jsp Beans,Custom tags.
3) Jdbc. Jndi
4) Declarative and Programmatic Authenctation & Authorization.
5) MVC Architecture
6) Struts Framework.
7) Declarative Exception Handling.
8) Modules Framework.
9) Tiles Framework.
10) Validator Framework.
11) Design Patterns.
12) Ant, Junit, Log4j,Eclipse.
13) Hibernate.
14) Spring.
15) Google App Engine
16)JavaScript
17)Ajax.
Important Servlet Interview Questions
1) Servlet Life Cycle?
2) How can you extract configuration information from web.xml inside your servlet?
3) How can you use ServletContext object to share information among servlets?
4) Difference between using response.sendRedirect() and requestDispatcher object for forwarding from one
servlet to another? Which one should be used and when?
5) What are the different ways to do session management in servlets?
6) How do u implement urlrewriting,hiddenfields,cookies and HttpSession objects?
7) How to send session identifier to client machine if cookie is disabled? Hints response.encodeURL() method.
8) What are the use of servlet filters.
9) Interfaces implemented to create a filter?
10) What is the difference between doFilter() method of Filter interface and doFilter() method of FilterChain
interface?
11) How to use Servlet Listener to create a website counter, and how to use it to show how many users are
online?
Important Jsp Interview Questions
1) Advantage of Jsp over Servlets.
2) Jsp Life Cycle?
3) Packages & Interfaces used When pagecompiler Servlet converts Jsp into Servlet?
4) What are Implicit Objects in Jsp?
5) What are the elements present in a jsp code apart from template data?
6) What are three types of directives used in jsp?
7) Difference between Scriptlet, Declarations and Expressions?
8) What are the different Action elements?
9) What is the difference between static include and dynamic include?
10)What are the different comments used in jsp?
11)What are the different scopes in which you can place bean objects?
12)When should we use Java Beans and when should we use custom tags?
List of questions asked
1. Please talk about your experience and recent work at [Company Name]
2. Explain the architecture of your project at [Company Name]
3. What is Encapsulation
4. What is the difference between Abstract Class and an Interface in Java
5. When do you use an Abstract Class and when do you use an Interface
6. How are constants defined in Abstract Class and in an Interface
7. How are methods defined in an Interface

8.
9.

Difference between equals() method and == in Java


Can you explain the above with an example? [Interviewer probably not satisfied with the explanation
given, so framed his own example and asked for explanation]
10. Example
int a = 5 ;
int b = 5 ;
what does a == b return ?
11. Example
String a = Hello
String b= Hello
what does a.equals(b) return ?
what does a==b return?
12. When do you overwrite equalsTo() method?
13. What is type casting in java? Explain with an example
14. What are checked and unchecked exceptions
15. What happens if you dont catch checked exceptions
16. If different complex objects are stored in a list how to find out type of object when it is retrieved from the
list? [Answer # using instanceOf keyword]
17. What are Servlets?
18. Explain lifecycle of a Servlet
19. When is the Servlet destroy() method called?
20. What is ServletRequest and ServletResponse?
21. What are different methods available in above the classes?
22. What is JSP?
23. How do you declare JSPs?
24. Explain lifecycle of JSP
25. What can be done with JSP that can not be done with Servlets and vice-a-versa?
26. How good are you with SQL and what version of DB did you use recently?
27. What is an index in RDBMS?
28. What is a primary key?
29. What is a unique key?
30. What is the difference between primary key and unique key?
31. What is your experience in using Spring Framework?
32. How did you use Dependency Injection in your project? Can you explain in detail?
33. What are the different types of injections that Spring support?
34. What are the different bean scopes in Spring?
List of questions asked
1. What are final, finally and finalize keywords in Java?
2. Is the following possible? Why?
3. Class Car {
4.
String engine;
5.
String parts;
6.
//getters and setters
7. }
8.
9. In some other class I want to say ...
10. final Car car = new Car();
11. car.setEngine();
car.setParts();
3. Do you know what is AJAX? How and when did you use it?
4. Does AJAX support HTTP GET or HTTP POST?
5. Have you used both? In which framework? [Answer # the candidate mentioned he used it with jQuery]
6. Do you what is JSON?
7. How did you use it? [exaplained w.r.t jQuery]
8. Can methods in interface be private methods?
9. Explain why?

10. What is the difference between static synchronized methods and non-static synchronized methods?
11. If you were to store all the license plates from Chicago into a Collection, what Collection would you use?
[interviewer was expecting me to answer the purpose of storing etc so I can choose best collection]
12. Can you tell me at least 2 implementation of Set Interface?
13. What is the difference between HashSet and TreeSet?
14. What is preemptive scheduling and time slicing?
15. Do you know Big O notations?
16. Difference between ArrayList and LinkedList?
17. Who will perform the JUnit Tests in your team?
18. When do you perform JUnit Tests?
19. Do you know what is JUnit Test Coverage?
20. Do you know any Test Coverage Tools?
21. What is Dependency Injection and Inversion of Control?
22. What type of DI does Spring Framework support?
23. Do you know what is method injection?
24. Is method injection supported by Spring framework?
25. What is Application Context?
26. What are the different bean scopes in Spring?
27. Can you explain Prototype bean scope in Spring?
28. Can you mark the interface methods as synchronized?
29. Difference between Checked and Unchecked Exceptions?
30. What are equal() and hashcode() methods in Java? Why do you need them?
31. If you were to design exception handling for a web application or any java application, what would be your
approach?
32. Do you know what is Test Driven Development [TDD]? Have you used it? Can you explain the process?
33. Difference between Abstract Class and an Interface? Which gives you performance and why?
34. How do you debug a SQL query?
35. Can you explain the Architecture of your previous project?
36. Why do you need ORM frameworks?
37. What key points would you consider when you were asked to migrate a JDBC based persistence to
Hibernate based approach?
38. Advantages and disadvantages of Hibernate?
39. Java 1.5 new features? What have you used so far? What is your favorite one?
40. What are Web Services and why do you need them?
41. Difference between SOAP and REST based web services?
42. Agile Methodologies SCRUM?
43. What is the default bean scope in Spring Framework?
44. Can you have more than one Spring Application Context?
45. Does Spring create a single bean instance when you declare a Bean class twice with different Ids?
46. What is MVC?
47. Struts vs Spring MVC?
48. Explain One-to-One and Many-to-One mapping in Hibernate?
49. List some of the linux/unix commands that you used on a daily basis?
50. What is ps command?
51. How to kill a process in linux?
52. Commands to check IO, CPU and Memory utilization in linux?
53. What are some of the features of Spring Framework?
54. Spring Transactions annotation syntax, AOP, roll-back annotation syntax?
55. In a distributed transaction, let us say you have a method that is calling 3 different methods one that
updates database, second that updates file and third that update a database again. If the second database
operation fails, how does transaction roll-back works in this case?
56. What is the difference between HashMap and Treemap?
57. What are checked and unchecked exceptions?
58. Can you tell me the Exception class hierarchy (top-down specifically)?
59. What are the different ways of soring a list?
60. How can you sort a list with complex objects?

61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.

Have you used Hibernate?


What are the difference object states in Hibernate?
What is Hibernate N + 1 problem?
Any experience with Web Services?
Have you used REST based Web Services?
Difference between XHTML and HTML?
Do you know CSS?
Do you know Javascript?
What Javascript frameworks have you used?
Have you used JSON?
Where exactly did you use JSON?
Do you know AJAX?
Have you used jQuery with AJAX?
How did you use JSON and where?
What kind of work have you done in the front-end?
Are you a front-end developer or a back-end developer?
Given a chance, can you work only on front-end?
Difference between REST and SOAP based Web Services?
Have you used Spring?
What modules did you use in Spring?
How did you use JSON in Java?
What JSON API did you use?
Do you know what is TypeMash?
Do you know what is Tiles Framework?
What design patterns have you used? Can you explain any one in detail?
How can you sort a list?
Have you used a Java Comparator ?
What is an Abstract Class? What is an Interface?
When do you use an Abstract Class and When do you use an Interface?
Can you create instances of an Abstract Class?
What is the difference between StringBuffer and StringBuilder?
What is Strategy Pattern?
What is a Builder Pattern?
What is the difference between function overloading and overriding?
Can you please explain little bit about your technical background, skill set, years of experience in each
technology, your current project, role and day to day activities
96. Did you use any framework for AJAX?
97. Can you explain how to make AJAX calls with jQuery?
98. What data format have you used to exchange data between client and server while using jQuery?
99. Explain a real-time scenario where you have used AJAX?
100.What is your experience with Front-end Frameworks?
101.How familiar are you with Spring MVC Framework?
102.Can you explain your Web Architecture on how you are using Spring MVC and what are the different
layers?
103.Have you used any Transactions?
104.What are Spring Transactions and how did you use them in your project?
105.What is your experience with Hibernate ?
106.If you were to integrate Hibernate into an existing project what are the high-level steps to do so?
107.What other modules of Spring have you worked?
108.When and Where did you used Spring Batch and Spring Integration Frameworks?
109.Explain the module that used Spring Batch and how did you use it?
110.What you ever configured Spring Batch for multi-threading?
111. What is lazy loading and when you do used lazy loading in Hibernate?
112.How do you enable lazy loading in Hibernate?
113.Have you ever encountered LazyInitializationException ?
114.What are the different ways to resolve LazyInitializationException in Hibernate?

115.What is your experience with Application Servers?


116.Do you know how to configure a DataSource in WebSphere or JBoss Application Server?
117.What is your experience with SQL?
118.Can you talk more about Spring Batch from a configuration perspective?
119.Can you talk about Custom Column Mappers in Spring Batch
120.Have you ever used Messaging in your application?
121.Can you explain a module where you have used Messaging in your application?
122.Are you more a front-end person or a back-end person?
123.Do you have experience working with an off-shore team?
124.What motivates you to work?
125.How are Exceptions handled in your application?
126.Have you used AOP?
127.Have you used Web Services?
128.What are some of the Design Patterns you have used recently?
129.What your used any ESB [Enterprise Service Bus]?
130.On Java side, did you used any API for JSON conversion?
131.How did you integrate Jackson with Spring MVC?
Over all interviewer focused on the following topics
Spring Framework
Spring MVC
Spring Batch
JMS
Explain about your current project? What technologies they have used and why is your role in the project?
Explain architecture of your project.
How many years of experience do you have in hibernate, struts, SQL, web services?
How did you use web services in your project?
Do you know how to create and consume web services?
How do your rate yourself with SQL?
Can you write really complex queries?
Have you done any SQL performance tuning? What methods have to used?
What is the difference between hibernate load and get ?
What are proxies in hibernate ?
Is your web application deployed in single JVM?
How are transactions handled within your web application?
Any experience writing custom tag libraries?
Any experience with workflow model or BPM?
How do you generate hibernate mapping files?
Have you ever used any tools to generate mapping files?
1. Can you briefly explain your current project and your technical skills and your role in the project?
2. What are final, finally and finalize keywords in Java?
3. What is a Factory Design Pattern?
4. What other Design Patterns have you used in Java?
5. What is the process to persist data in Java?
6. What are Joins in SQL?
7. Can you explain Left Outer Join in SQL?
8. Lets assume you are trying to connect to database using Hibernate, can you briefly explain the steps?
9. What are different types of injections in Spring?
10. What is WSDL?
11. What is PortType in WSDL?
12. Can you explain the structure of a SOAP Message?
13. What are different aggregation types in UML?
14. What is SQL injection?
And some general discussion on the projects and technologies. Over all interviewer focused on the following topics

Core Java
Web Services

SQL
Hibernate
UML
This was a telephonic interview and the candidate was asked the following questions
1. Can you briefly explain your technical skill set and your experience with different Java Frameworks,
especially with Spring and Hibernate ?
2. Can you explain your current project and the technology stack used ?
3. On what design patterns is Spring Framework built? Can you briefly explain them?
4. What are benefits of IoC?
5. What are different benefits of Spring Framework?
6. Have you worked on any other Spring Modules other then Spring Core?
7. What are the features of Spring Framework?
8. What is AOP ?
9. Have you used AOP in your current project?
10. What is the difference between Bean Factory and Application Context?
11. Can you explain Bean life cycle in Spring Bean Factory Container?
12. What is auto-wiring?
13. What are different types of auto wiring in Spring?
14. What are different Bean scopes in Spring?
15. What are differences between J2EE and Spring Framework? [Interviewer actually intended to ask
differences between EJB Container and Spring Container]
16. What is JDBCTemplate in Spring?
17. What are the steps to integrate Spring with Hibernate?
18. What is the difference between regular JDBC exceptions and Spring JDBCTemplate exceptions?
Most of the questions were focused on Spring and Hibernate Framework because Interviewer clearly mentioned that
they are looking for a candidate who can help them with project that is going to be primarily built on Spring and
Hibernate Frameworks.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.

What is the difference between Method Overloading and Method Overriding?


What is the difference between Runtime Exception and Compile Time Exception?
What is a checked exception? What is an un-cheked exception?
Do Java support Multiple Inheritance? If yes, how?
What is a Marker Interface? Give an example.
What is the difference between JRE, JDK and JVM?
Explain the visibility of 4 types of access modifiers Public, Protected, Default, Private?
Can a class constructor be private? If yes, why do we need such constructors?
What is a wrapper class?
What is an immutable object?
Can we declare a variable inside an interface? If yes, then what should be the variables modifiers?
What is an Abstract Class?
What is coupling and cohesion?
What is type-casting?
What is the default value of a char variable?
What is the difference between Bitwise AND and Logical AND operator?
How do you iterate through a HashMap?
What are the advantages of using ArrayList<String> over String Array (String[]) ?
What is Generics?
What is Reflection?
What is Auto-Boxing?
How are Javadoc comments different from normal comments?
What is a Object Factory Method?
What is Var Args?
Is it possible to write a try block without catch?
Tavant Interview Questions.....
Tavant Technologies
Round 1:F2F

1) Tell abt ur technical skills


2) How to work with ajax applications?
4) Asked about page factory design concepts.
5) What are the collections u used in ur project?
6) Framework explanation
7) How to find no of rows or columns in a table?
8) Diff b/w interface and abstract class?
9) Various oops concepts used in the project?
10) Roles and responsibilities.
11) SQL queriesa) how to find duplicate records in a table b) Display the name of the emp who is getting
10th maximum salary
12) Logical questions:
i) A 2l bottle and a 4l bottle, By this u have to give me 3l of water? Is it possible? If yes tell me how
ii) 8 balls, having same color and weight, out of that 1 is defective, a physical balance is given, using this
how to find the defective one.
Round 2
1. What is run-time polymorphism? Explain with program? Where is it achieved?
2. SQL queriesemp table fieldsename,eid,age
a) Find the name of the emp who has 3rd max age
b) Having clause and where clause
3. Logical questions
a) Cake in round shape, u have to cut the cake by 3 times only, and u have to divide into 8 equal pieces
b) Using 5 zeros, how to make it as 120
c) He gave me a paper, asked me to tore the paper once, to make 3 equal pieces
Round 3- HR+ Managerial round
1. Tell abt ur self
2. Why u r looking for the job?
3. What are the difficulties u faced in ur previous job?
4. He is asking the same questions in different ways for 15 min
5. Framework
6. Difference b/w abstract class and interface.
7. Scenario-an abstract class implements an interface, can the abstract class implement the methods of
interface?
8. From that he asked that do u perform auto it scripts in parallel execution?
9. Difference B/w primary key and unique key
10. Can unique key column hold null values? If yes how many null values?
11. Use of super keyword, order of execution
12. Collections u used in the project
13. When array will be used ? and when array list will be used?
28. Experienced Java Interview questions asked by CGI
Company Name : Wipro
Sent By : Sai Pavan
Interview Questions:
1. Tell about your self ?
2. Write the hierarchy of Collection framework?
3. Explain about the Struts frameworks.
4. What is a String in Java?
5. What is Iterator?
6. List some methods in the ArrayList class?
7. Whats the difference between == and equals method?
8. What is the difference between a Vector and an Array. Discuss the advantages and disadvantages
of both?
9. What does the keyword "synchronize" mean in java. When do you use it? What are the
disadvantages of synchronization?
10. What is JDBC? Describe the steps needed to execute a SQL query using JDBC?
11. What is the ActionForm in struts?

12. What design patterns are used in Struts?


13. What is the default transaction attribute for an EJB?
14. What is the difference between session and entity beans? When should I use one or the other?
15. How you will display validation fail errors on jsp page?
Company Name : HCL Technologies Limited
Sent By : Manideep
Interview Questions:
1. What is inline thread ?
2. Write a sample program using iterate through a hashmap and print values?
3. How to sort arraylist?
4. what is bean managed transaction in ejb?
5. what is named query in hibernate ?
6. what is the use of having keyword in sql?
7. Difference between the stored procedure and functions ?
8. Explain various types of struts actions?
9. who is responsible for serilization ?
10. Is there any chance for deadlock in java ?
11. spring simpleform controlller and method?
12. what is webservice?
13. What are jsp core librabries?
14. Explain various level of synchronization?
15. How to call stored procedure from hibernate?
Company Name : TCS
Sent By : Prasanna
Interview Questions:

Thanks

whats inline thread?


iterate thro a hasmap and print values
How to sort arraylist?
whats bean managed transaction - ejb
whats named query - hibernate
whats the use of having keyword - sql
oracle stored procedure and functions
various types of struts actions
whos responsible for serilization .
is there any chance for deadlock in java
spring simpleform controlller and method
whats webservice?
what are jsp core librabries?
various level of synchronization?how to call stroed procedure from hibernate
Prasanna. All the best !!!!!!!

Company Name : ADP


Sent By : Vamshi Krishna
Interview Questions:
how can execute the prepared statement is executed in more than one in application? Where the ps object is
created either db or application?
What is Cloneable Interface?
How to decide whether to use Interface or Abstract Class?
What are the types of Executor Interfaces ?
What are the core interfaces in Hibernate?

If two Interfaces have same Method, how to handle that Method in a Class implementing these two
Interfaces?
Which type of EJB can use bean pooling?
Difference between Include Directive & Include Tag?
what use of Ajax?
What parsers are supported in Ajax?
what situation validation framework is applied in struts framework?
what is difference between the validation.xml and validation-rules.xml?
whats difference between the HTML and Dhtml?
Thanks Vamshi Krishna. All the best !!!!!!!
Company Name : Syntel
Sent By : Mallikarjun
Interview Questions:
1. Why native methods are used ?
2. How do you declare a page as Error Page. What tag you include in a JSP page so that it goes to
specified error page in case of an exception ?
3. Difference between Include Directive & Include Tag ?
4. Servlet is a java class. So, can there be a constructor in Servlet class or not ? Why ?
5. What's the difference between forward & include tags? What URL (absolute or relative) is used in
RequestDispatcher forward?
6. Is it possible to write methods in JSP ? If so, how ?
7. Difference between JSP & Servlets ?
8. Difference between Hashtable & HashMap ?
9. By default, Hashtable is unordered. Then, how can you retrieve Hashtable elements in the same
order as they are put inside?
10. ejbActivate() Vs ejbPassivate()
11. ejbCreate() Vs ejbPostCreate()
12. ejbLoad() Vs ejbStore()
13. Which type of EJB can use bean pooling ?
14. How can you call an EJB from a JSP/Servlet ?
15. How to configure Data Source in WebSphere server ?
16. Oracle Thin Driver comes under which type of Driver ?
Thanks Mallikarjun. All the best !!!!!!!
Company Name : TCS
Sent By : Rithika
Interview Questions:
1. Tell about your self ?
2. What is the difference between a constructor and a method?
3. What is the difference between an Interface and an Abstract class?
4. Explain different way of using thread?
5. Explain polymorphism. Provide an example.
6. What is use of finally keyword in exception handling?
7. What is the purpose of garbage collection in Java, and when is it used?
8. what will be the output of the following program?
int i;
for(x=0;x<14;x++)
{
if(x<10)
{
system.out.println("value is: " + (i+x));
}
}
9.

Can a table have two primary keys?

10. how to create table with in the procedure or function?


11. What is the role of Action Class?
12. Can I have an Action without a form?
13. What is the Difference between DispatchAction and LookupDispatchAction?
Thanks Rithika. All the best !!!!!!!
Company Name : CSC
Sent By : Murali Raj
Interview Questions:
1. Tell me about yourself?
2. What is the difference between String and StringBuffer?
3. What do you mean by immutable?
4. Can you explain the same with an example?
5. How do you compare objects of String and StringBuffer?
6. Can you list few methods that are available at Object class level?
7. Why is thread methods like notify and notifyAll is defined at Object level?
8. What are run time exceptions?
9. What is Marker interface?
10. What is the serialization?
11. How to make a class or a bean serializable?
12. If two Interfaces have same Method, how to handle that Method in a Class implementing these two
Interfaces?
13. Explain Servlet Life cycle ?
14. What is the difference between GET and POST?
15. What is SingleThreadModel?
16. What is the difference between ServletContext and ServletConfig parameter?
17. How can we know that a session ha already existed or not ?
Thanks Murali . All the best !!!!!!!
Company Name : Manhattan Associates
Sent By : Varun
Interview Questions:
1. Tell about yourself
2. Why do you want to leave the present company ?
3. What do you know about our (Manhattan Associates) company ?
4. About EJB types. CMP, BMP, Session, Entity beans, their differences, when to use what type of beans ?
5. Can a Client Context call ejbRemove() method ?
6. Who calls the methods ejbLoad() and ejbStore() and where the state information is stored when they are
called ?
7. Do you know about Sequence Diagrams in UML ?
8. Which is faster in execution - JSP or SERVLET ? Why ?
9. What is the difference between Callable Statement and Prepared Statement?
10. Can we declare final method in abstract class ?
11. Can we declare abstract method in final class ?
12. What is the difference between Inner Join and Outer Join ?
13. How can you pass an object of data from one JSP to another JSP ?
14. When these methods are used ? ejbActivate(), ejbPassivate() and ejbRemove() ?
15. What is the difference between ejbPassivate() and ejbRemove() ?
16. Can the same object of Stateless Session bean be shared by multiple clients ?
17. Can the same object of Stateful Session bean be shared by multiple clients ?
18. How do you manage transactions in EJB ?
Thanks Varun. All the best !!!!!!!
Company Name : Keane India (NTT DATA)
Sent By : Ashish
Interview Questions:
1. In How many ways can u create an object for a class?
2. Explain abount Static Methods ?
3. What is abstraction?

4. What is Encapsulation?
5. Difference between error and exception
6. What is Life Cycle of Servlet?
7. project architecture in interviews?
8. Can we create constructor for abstract class?
9. Can we create constructor for abstract class?
10. what is port no of oracle
11. How to synchronize ArrayList
12. Why do we need struts?
13. How will you decide whether to use Interface or abstract ?
14. Difference between ApplicationServer and webserver?
15. What is the diff between synchronized and volatile?please write with example
16. is array list is synchronized
17. Difference between Jsp and servlets?
18. Difference between JspWriter and PrintWriter?
19. how to import a package without using import key word?
Thanks Ashish. All the best !!!!!!!
Company Name : L&T Infotech
Sent By : Geetha
Interview Questions:
1. Tell me about your self?
2. What is the difference between an Interface and an Abstract class?
3. What is the purpose of garbage collection in Java, and when is it used?
4. Describe synchronization in respect to multithreading.
5. Explain different way of using thread?
6. What are pass by reference and passby value?
7. What is HashMap and Map?
8. Difference between HashMap and HashTable?
9. Difference between Vector and ArrayList?
10. Difference between Swing and Awt?
11. What is the difference between a constructor and a method?
12. What is an Iterator?
13. State the significance of public, private, protected, default modifiers both singly and in
combination and state the effect of package relationships on declared items qualified by these modifiers?
14. What is an abstract class?
15. What is static in java?
16. What is final?
Thanks Geetha. All the best !!!!!!!
Company Name : Mindtree
Sent By : Prathap
Interview Questions:
1. How does garbage collection work?
2. How do you create a thread dump?
3. How do you profile an application?
4. What's new and/or up and coming in the industry?
5. How to make a collection or map immutable without using any existing features?
6. What frameworks would you use to develop your dream application?
7. What are the main benefits of using Spring on a project ?
8. What is AOP ?
9. How hibernate implements lazy loading ?
10. What is the second level cache in Hibernate ?
11. What are the main new features of Java5 ? Same question with Java6 ?
12. Difference between Set, Map and List.
13. Importance of hashcode and equals. When to implement what?
14. Difference between immutable and final.
Thanks Prathap. All the best !!!!!!!

Company Name : CapGemini


Sent By : Priya
Company Name : Siemens
Sent By : Sunitha
Interview Questions:
1. How do you configure using spring mvc with Dao class?
2. how to include one jsp into anther jsp? which tag we are use write it?
3. How to connect more than one database in hibernate?
4. i want change my database instead of oracle using MySQL in hibernate where we configure?which class u r
use?
5. How many ways possible Multi Threading? which ways is better?
6. How to write form bean tags in your struts-configuration file?
7. I have 4 action classes i want get second action class how can i get it? where are you configure? can u write
code ?
8. Tell me about single thread model in servlets?
9. WHAT is serialization? how can you achieve it?where are implement in your project?
10. How can you achieve encapsulation your project?
11. what are the problems you get doing hibernate projects?
12. how can you connect more than one database in your hibernate application?
13. difference between dialect and driver?
14. is it possible without hibernate mapping file doing hibernate application?
15. is it possible without hibernate configuration file doing hibernate application?
16. class states in hibernate?
17. How can you increase connection pool-size in web logic?
18. How integrate your project in spring with hibernate?
Thanks Sunitha. All the best !!!!!!!
Company Name : MindTree
Sent By : Abhinav
Interview Questions:
1. Tell me about your self?
2. What is stack and heap memory in java?
3. What is runtime exceptions? Give some examples?
4. Write a actual singleton java class?
5. Difference between Hashtable & HashMap ?
6. In what cases you will use Abstract Class and Interfaces?
7. How do you declare a page as Error Page. What tag you include in a JSP page so that it goes to specified
error page in case of an exception ?
8. Difference between Include Directive and Include Tag ?
9. What is the importance of SessionFactory in Hibernate?
10. Difference between merge() and Update() methods?
11. Difference between page and pagecontext in jsp ?
12. Difference between sting and string buffer class ?
13. What is the difference between doPost and doGet methods?
14. Whats the difference between forward and include tags? What URL (absolute or relative) is used in
RequestDispatcher forward?
15. What is Difference between iterator and list iterator?
Thanks Abhinav. All the best !!!!!!!
Company Name : HCentive Technology India Pvt Ltd
Sent By : Rishika
Interview Questions:
1. Tell me about your self?
2. Explain your current project ?
3. What is static in java?
4. What is the use of singleton class ?
5. Oracle Thin Driver comes under which type of Driver ?
6. Is it possible to write methods in JSP ? If so, how ?

7. Can u write final method in abstract class ?


8. Difference between method overloading and overriding ?
9. What is Difference between interface and abstract class ?
10. How to get the sessionfactory obj in hibernate ?
11. What is the difference between exception and error?
12. Difference between java.util.date and java.sql.date ?
13. What is comparator ?
14. We have equals() to compare two methods then why comparator again ?
15. Which type of EJB can use bean pooling ?
16. How can you call an EJB from a JSP/Servlet ?
17. Who is loading the init() method of servlet?
Thanks Rishika. All the best !!!!!!!
Important Spring Interview Questions
Spring FAQ's
1. What is Spring IOC Container ?
2. Does Singleton from Spring Container is thread safe?
3. Why Spring MVC is better than Struts?
4. What is benefit of using JdbcTemplate? Why should you use JdbcTemplate in Spring?
5. How do you handle SQLException in Spring?
6. How to you setup JDBC connection pool in Spring etc?
7. What is Spring Integration?
8. How to call remote method by RMI using Spring
9. What scheduling feature Spring framework provides?
10. How do you make a Singleton bean to lazy load in ApplicationContext which loads all Singleton beans
eagerly during startup?
11. Does Spring Security part of Spring framework?
12. How to configure Spring using Annotation?
13. Which version of Spring have you used recently and what is difference you observed from previous spring
version?

Das könnte Ihnen auch gefallen