GnuDeveloper.com

Java interview question part 2

1. Singleton class: I was asked everything about it. To code the entire class and then cross questions on usage of every keyword.

Link to prepare: http://www.javaworld.com/article/2073352/core-java/simply-singleton.html

2. Hashing algorithm and how hash map works in detail.

3. String creation in heap & string pool.

4. Entire collection framework with scenarios when to use what & why?

5. Basics of multithreading concepts.

6. Functional Interface (I could not answer, I guess this is made available in Java 8).

7. Few performance issue related questions.

8. Dependency Injection in Spring and role of IOC.

9. Scope of spring beans and when to use which?

10. MVC Design pattern****

11. Few questions on applicationcontext.xml and web.xml (Important tags)

12. Member variable declaration in Interface.

13. One scenario in which getInstance method in Singleton class has to be overridden.

14. Explain briefly about work done during technical career

15. Explain any one project what all was done in that like architecture, technologies etc.

16. Difference between Static Class and Singleton Class**

17. Design patterns like singleton, session facade or any others used during implementation**

18. What is coupling and decoupling

19. what is cloud ... Any idea on that

20. What kind of web services you have used

21. Have you worked on restful web services?

22. Were you ever involved in designing of project?

23. How many lines of code approximately you have written in your technical career

24. Have you worked on Spring framework

25. Use of private constructor

26. Private constructor and static class

27. Resolving circular dependency

28. Design patterns – Singleton***

29. Any of the project architecture you have worked (Basically the latest project) and questions based on your project description.

30. Code for Singleton Design pattern and how to make it thread safe and question based on your code.

31. Questions on static, transient & volatile keyword and some program on that.

32. Serialization v/s externalization.

33. Abstract class v/s Interface. When to use what and examples for that.

34. Asking a scenario, you have to design Classes/Interfaces, decide the methods and the implementations (a bit tricky/complicated scenario) then question based on your code.

35. How wait and notify can be implemented, write a piece of code and question based on your written code

36. Some question on web services (Rest& SOAP). How you achieve security on Rest based services.

37. Hash table and Hash Map. Write Equals& Hash Code Implementation.

38. Real time scenario where you have used Link List and Array List.

39. Code for stack implementation.

40. Basics of Spring & Hibernate (Like Spring Injections, Autowiring, Hibernate Mappings ...)

41. Write a method to return largest N numbers in a given array, for the user input N.

[2,5,9,11,7,6], 3 --> [7,9,11]

[4,8,13,2,3,10,14,16], 4 --> [10,13,14,16]

42. Write some code in finalize method and call from class

43. Explain stack with real example

44. Stack and queue

45. Priority queue/ blocking queue

46. Linked list with example

47. Inheritance, aggregation and Composition explain with real time example When will you use inheritance/aggregation/composition

48. Scheduling algorithms

49. Data structures

50. Final, Finally and Finalize

51. Garbage collector, memory leak

52. Call by value and call by reference

53. Current project architecture in detail and roles.

54. Explain Polymorphism and implemented scenarios.

55. Collections (java.util package).

56. Explain Singleton Class in detail and its implementation.

57. Why we are using Spring framework and it’s benefits.

58. Spring MVC design architecture.

59. Hibernate definition and difference b/w hibernate and JDBC.

60. What is jUnit and experience in jUnit.

61. Detailed functional and technical architecture of my previous project

62. This included follow up questions pertaining to how each layer(of three tiers) functioned

63. Few questions from Spring AOP and DI

65. What differentiates Spring MVC from other MVC frameworks like Struts

66. Questions from Singleton, Factory, Decorator, Adapter design patterns

67. W a p power(m, n)

a. It should be handle space and memory complexity?

b. Write JUnit test cases too wtih +ve and -ve?

68. Find out 2nd height salary of emp?

69. Find out employees who does not belongs to any dept?

70. Increment 10% salary for all deportment employees?

71. Difference b/w join point and point cut?

72. How to access reference variable in static methods?

73. How to handle dead lock in multi-threading?

74. Difference b/w tracing and debugging?

75. How to maintain authentication in rest web services?

76. Types of dependency injections?

77. Advantage of final keyword?

78. SOLID principles in OOPS?

http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

79. Design a car, it should be run in water, air, in future it may be in Mars?

Use interfaces, Abstract class

80. Write reverse the string program with jUnit and exception.

a) Explain Time complexity and space complexity program?

81. Advantage of spring?

82. Different type of injection?

83. Bean factory and application context?

84. cross cutting concerns - AOP

85. How you write an advice?

86. What is advice and what is aspect?

87. Joint point, point cut

88. Weaving in spring

89. MVC

90. REST APIs

91. property place holder - spring profiles, maven profile

92. Scope of bean

93. Factory design for a room and how will you convey the design

94. Singleton class

95. Query that returns second highest salary

96. Most challenging task

97. Sonar

98. Performance - out of memory issues? Caching, jProfiler, etc

99. Why you have chosen Spring frame work? What are the features of Spring?

100. Have you worked on any design documents? What are all the design diagrams that you are familiar?

101. What are all the components involved in Usecase diagram?

102. How to represent public,private and protected access specifiers in class diagram?

103. Explain about context object and autowired concept in spring?

104. How many ways we can create context object in spring and explain in detail?

105. What is beanfactory? what is the difference b/w beanfactory and Application context?

106. What are all the design patterns that you are familiar?

107. How can I break the singleton design pattern in my application?(Can I extend singleton class,clone singleton class,refer singleton instance in non static method?)

108. How many ways we can configure beans in spring?

109. Explain Spring MVC flow in depth?

110. What is meant by cache? Can I implement my own cache in Enterprise applications? What approach is best?

111. How to call non static method from static method?

112. What will happen if I can implement two interfaces having same method declaration?

113. Use of Hibernate when compare to JDBC?

114. How to write unit test cases using JUNIT?

115. What is the diff b/w System.exit(0),1 and -1?

116. Why we are using connection pooling?

117. Explain current project and role and responsibilities?

118. What is the latest version of JDK? and its features?

119. Is JRE is plat form independent?

120. Explain the diff b/w water fall and agile life cycle models?

121. Write an HQL query to retrieve emp details not having any dept?

122. Write an HQL query to retrieve 2ndhighest salary of emp without using any SQL in built in functions?

Latest Questions:

123. How do you implement the a business logic to support different SOAP versions?

124. What is a visitor design pattern?

125. What is an abstract design pattern?

126. What do you implement abstract design pattern for two different loggers (log4j, JBoss Common Logging)?

127. How does a JMX port registry works?

128. Class diagram for the visitor design pattern and abstract design pattern?

129. How does a logging works? Asynchronously or Synchronously?

130. What is the biggest technical challenge faced in the current project?

131. What are the things to be taken care when interacting with third party systems?

132. How does a SOAP security works?

133. How does we implement the SOAP authentication?

134. How does authentication in web.xml works in case of DHCP protocol?

135. How does the filtering works in web.xml?

Groups: