Only Questions
Only Questions
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?
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.
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?
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 .
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?
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
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.
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;
}
}
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
State
Text area
Doctor complaints:
Disease
8.
9.
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.
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.
Thanks
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.
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 !!!!!!!