100 java interview questions

Hi everyone, in this blogpost, I am specifying 100 interview questions which are commonly asked during a java developer interview. It includes questions about core java, j2ee, struts, servlets, jsp, hibernate, spring and database.

The questions are as follows:
  1. Difference between method overloading and method overriding.

  2. Different types of Annotations used.

  3. Explain about lists and sets. What are there differences ?

  4. Difference between super() keyword and this() keyword ?

  5. Difference between abstract class and interface. When are they preferred ?

  6. Static and dynamic binding in java?

  7. What is synchronization in java? What is synchronized method ?

  8. Difference between serializable and externalizable interface in java.

  9. What is abstraction ? What is polymorphism? What is runtime and compile time polymorphism ?

  10. What is generics in java ?

  11. What are abstract class and abstract method ?

  12. What is marker interface ? Examples of marker interface ?

  13. What is static method, static block and static class ?

  14. What is Final method, final class and final variable in Java ?

  15. What is finalize in java?

  16. Garbage collection in java.

  17. What is daemon thread.

  18. Different types of errors in java.

  19. Difference between error and exception.

  20. Difference between StringBuffer and StringBuilder.

  21. What is multithreading ?

  22. Difference between Comparator and Comparable interface.

  23. What is encapsulation and what are there different scopes.

  24. What is join in database.

  25. Difference between drop, truncate and delete table.

  26. What is trigger in database.

  27. What is Cursor in database.

  28. Steps in connecting with database using jdbc.

  29. What are the different drivers of jdbc.

  30. What are jstl tag libraries ?

  31. How to pass values from jsp to server and from server to jsp ?

  32. Different scope values of jsp:usebean ?

  33. What are implicit objects in jsp ?

  34. How jsp communicate with java file ?

  35. Life cycle of jsp.

  36. Expression, declaration and scriptlet in jsp

  37. Difference between foreward and sendRedirect.

  38. Difference between jsp: forward and page:forward.

  39. What happens when a button is clicked in jsp page.

  40. Difference between doGet() and doPost(). What are the parameters of doGet() ?

  41. Life cycle of Servlet.

  42. What is Servlet Context(). Difference between ServletContext() and ServletConfig() ?

  43. What is pre initialization of Servlet ?

  44. How to create deadlock in Servlet ?

  45. How to get information of one servlet in another.

  46. What are Servlet error codes ?

  47. What is struts framework ? Importance of Struts framework.

  48. Important classes in struts framework.

  49. What is ActionServlet ?

  50. What is ActionClass ?

  51. What is ActionForm?

  52. How to handle exceptions in Struts ?

  53. Explain the flow of control in Struts ?

  54. How to map objects in Struts ?

  55. How does action class is invoked in Struts and who invokes it ? How is it different in Spring ?

  56. Difference between dispatchAction and lookupDispatchAction in Struts ?

  57. Configuration files used in Struts ?

  58. What is JSF ? How JSF is different from JSP ?

  59. What are the advantages of JSF ?

  60. What are navigation rules in JSF ?

  61. How struts is different from JSF ?

  62. Difference between managed bean and navigation bean. ?

  63. Life cycle of JSF.

  64. What are the main tags in JSF.

  65. What is Spring framework ? Advantages of Spring framework ?

  66. What is point cut and join point in Spring ?

  67. Difference between bean factory and Application context in Spring ?

  68. What is XML bean factory ?

  69. What is Aspect Oriented programming ?

  70. What is Aspect ?

  71. What is Advice ? What are the different types of advice?

  72. How to configure spring in web application.

  73. How to integrate hibernate with spring.

  74. How to integrate JSF with Spring ? What is delegation variable resolver ?

  75. Bean initialization in Spring.

  76. Bean destruction in Spring.

  77. Different attributes of Spring bean.

  78. What are the different types of AutoWiring ?

  79. How to integrate Spring with Struts.

  80. 7 building blocks of Spring.

  81. What is different in Spring 2.5 than its previous versions.

  82. Configuration files used in Spring and hibernate ?

  83. What is around advice ?

  84. What are different scopes of spring ?

  85. What is lazy initialized bean ?

  86. Explain spring mvc framework.

  87. What is dependency injection. Explain the types of dependency injection.

  88. What is hibernate ? Advantages of hibernate.

  89. What is second level cache in hibernate.

  90. Query Cache in hibernate.

  91. Difference between get and load in hibernate.

  92. What is named SQL Query in hibernate.

  93. Difference between sorted and ordered collection in hibernate.

  94. What is session in hibernate.

  95. Difference between save, persist and saveOrUpdate methods in hibernate.

  96. What is SessionFactory in hibernate ?

  97. Difference between get and load in hibernate ?

  98. What is N+1 problem and how to avoid this.

  99. What is lazy initialization exception.

  100. What is singleton pattern ? How to implement singleton pattern.
These are some of the most important interview questions in Java. I am sure if you know the answers of all these questions, it is very easy to crack an interview. But I recommend to learn some more questions from other sources.

Please comment below if you have any doubts/suggestions. All comments would be responded soon.

Thank you for reading the post !!!

Comments

Popular posts from this blog

Difference between "diff" and "sdiff" commands in Unix

Anonymous classes in C++