0% found this document useful (0 votes)
8 views7 pages

Core Java Interview Questions 200

The document contains a comprehensive list of over 200 core Java interview questions covering various topics such as Java fundamentals, Object-Oriented Programming, exceptions, collections, concurrency, Java memory model, JDBC, design patterns, and more. Each question is designed to test the candidate's knowledge and understanding of Java concepts and practices. This resource serves as a valuable tool for both interviewers and candidates preparing for Java-related job interviews.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views7 pages

Core Java Interview Questions 200

The document contains a comprehensive list of over 200 core Java interview questions covering various topics such as Java fundamentals, Object-Oriented Programming, exceptions, collections, concurrency, Java memory model, JDBC, design patterns, and more. Each question is designed to test the candidate's knowledge and understanding of Java concepts and practices. This resource serves as a valuable tool for both interviewers and candidates preparing for Java-related job interviews.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Core Java Interview Questions (200+)

1. What is JVM, JRE, and JDK?

2. Explain Java compilation and execution process.

3. Difference between JDK 8 and JDK 17.

4. What are the main features of Java?

5. Explain platform independence in Java.

6. What is bytecode?

7. What are reserved keywords in Java?

8. Difference between == and equals() method.

9. What is a literal in Java?

10. Explain autoboxing and unboxing.

11. What is Object Oriented Programming?

12. Name the four pillars of OOP.

13. Difference between class and object.

14. What is inheritance and its types?

15. Explain method overloading vs overriding.

16. What is dynamic binding?

17. What is abstraction?

18. Difference between abstract class and interface.

19. Explain encapsulation with example.

20. Can we create an object of an abstract class?

21. Difference between String, StringBuilder, StringBuffer.

22. Why are Strings immutable?

23. How does String intern pool work?

24. Explain substring memory behavior.

25. How does equalsIgnoreCase() work internally?

26. Difference between checked and unchecked exceptions.

27. Explain try, catch, finally blocks.

28. Can finally block run without catch?

29. What is multi catch in Java 7?

30. How to create a custom exception?

31. Difference between ArrayList and LinkedList.

32. How does HashMap work internally?


Core Java Interview Questions (200+)

33. Difference between HashMap and Hashtable.

34. What is fail fast and fail safe iterator?

35. Explain ConcurrentHashMap internals.

36. Difference between Set and List.

37. How does TreeSet maintain order?

38. What is load factor in HashMap?

39. Explain IdentityHashMap.

40. Difference between Iterator and ListIterator.

41. What are generics? Give benefits.

42. Explain type erasure.

43. Difference between ? extends T and ? super T.

44. Can we create arrays of generics?

45. What is a bounded type parameter?

46. What is a lambda expression?

47. Explain functional interfaces.

48. Purpose of default and static methods in interfaces.

49. Difference between map and flatMap in Streams.

50. How to filter a list using Streams?

51. What is Optional and why use it?

52. Explain method references.

53. What is a Stream pipeline?

54. Explain parallel streams.

55. What are collectors?

56. Difference between process and thread.

57. Ways to create a thread.

58. Explain thread life cycle.

59. Difference between Runnable and Callable.

60. Purpose of Future and CompletableFuture.

61. Explain synchronized keyword.

62. What is an intrinsic lock?

63. Difference between synchronized method and block.

64. Explain volatile keyword.


Core Java Interview Questions (200+)

65. What is a deadlock? How to prevent?

66. Explain wait, notify, notifyAll.

67. What is ThreadLocal? Use cases.

68. Difference between CyclicBarrier and CountDownLatch.

69. Explain ReentrantLock.

70. What is ForkJoinPool?

71. What is ExecutorService?

72. Difference between fixed and cached thread pools.

73. Explain Semaphore.

74. What is Phaser?

75. Explain Atomic classes and CAS.

76. Describe JVM architecture.

77. Explain class loader subsystem.

78. What is class loader delegation model?

79. Types of Java class loaders.

80. What is the method area?

81. Explain JIT compiler.

82. Meaning of -Xms and -Xmx options.

83. How to take a heap dump? Why?

84. Explain metaspace.

85. What was PermGen and why removed?

86. Explain garbage collection process.

87. What are GC roots?

88. Difference between minor and major GC.

89. Explain generational GC.

90. Basics of GC tuning.

91. Difference between InputStream and Reader.

92. Explain BufferedReader and BufferedWriter.

93. What is NIO and its advantages?

94. Explain channels and buffers.

95. What is a memory mapped file?

96. Explain predicate, function, consumer, supplier.


Core Java Interview Questions (200+)

97. What are primitive functional interfaces?

98. How to compose functions?

99. Explain concept of currying.

100. What is Stream reduction?

101. Explain java.time API.

102. Difference between Instant and LocalDateTime.

103. Convert Date to LocalDateTime.

104. Explain Period and Duration.

105. Use of Clock class.

106. Explain Singleton pattern thread safe.

107. What is Factory pattern?

108. Explain Builder pattern.

109. What is Strategy pattern?

110. Observer pattern example in Java.

111. Difference between composition and inheritance.

112. Explain JDBC architecture.

113. Difference between Statement and PreparedStatement.

114. What is a JDBC driver? Types?

115. What is connection pooling?

116. Explain batch processing in JDBC.

117. What is reflection? Pros and cons.

118. How to create a custom annotation.

119. Difference between @Override and @FunctionalInterface.

120. Explain retention policy.

121. What is serialization?

122. Difference between Serializable and Externalizable.

123. What is serialVersionUID?

124. How to customize serialization?

125. Explain transient keyword.

126. What are Java modules?

127. Purpose of module-info.java.

128. Difference between requires and exports.


Core Java Interview Questions (200+)

129. How do modules improve encapsulation?

130. What are records? Benefits?

131. What are sealed classes?

132. Use cases for sealed interfaces.

133. Explain takeWhile and dropWhile.

134. What is iterate with Predicate?

135. Explain Optional.or and ifPresentOrElse.

136. Purpose of Optional.stream.

137. Explain switch expressions.

138. What is yield keyword?

139. What are text blocks? Benefits?

140. Explain var keyword. Limitations?

141. Describe Java Memory Model.

142. Explain happens before relationship.

143. When to use volatile?

144. Difference between ReentrantLock and synchronized.

145. How to create immutable class?

146. Explain CopyOnWriteArrayList.

147. Difference between Future and CompletableFuture.

148. Explain fork join framework.

149. Explain G1 garbage collector.

150. What are ZGC and Shenandoah?

151. How does reference counting GC work?

152. Explain SoftReference and WeakReference.

153. Causes of OutOfMemoryError.

154. How to profile a Java application.

155. What is just in time compilation.

156. Explain escape analysis.

157. What is method inlining?

158. How to reduce GC pauses.

159. Explain Java Security Manager.

160. What are class loader attacks?


Core Java Interview Questions (200+)

161. Prevent SQL injection in JDBC.

162. Secure coding best practices in Java.

163. Difference between TCP and UDP sockets.

164. Explain URL vs URI.

165. What is HttpURLConnection?

166. Difference between HttpClient and HttpURLConnection.

167. When to use BigInteger.

168. Difference between BigDecimal scale and precision.

169. Explain IntStream and DoubleStream.

170. Difference between range and rangeClosed.

171. Explain collect vs reduce.

172. How does groupingBy work?

173. Difference between Random and SecureRandom.

174. What is ThreadLocalRandom.

175. Explain enums in Java.

176. Can enums implement interfaces?

177. How to add fields and methods to enums.

178. Explain ResourceBundle.

179. Difference between Locale and TimeZone.

180. Are lambdas slower than anonymous classes?

181. How to debug lambda expressions.

182. What is pattern matching for instanceof.

183. Pattern matching for switch preview.

184. Difference between Stream and Iterable.

185. Can a stream be reused?

186. What are virtual threads (Project Loom)?

187. Difference between virtual and platform threads.

188. What are record patterns (preview)?

189. Explain VarHandle API.

190. Difference between compile time and runtime polymorphism.

191. What is method hiding in Java?

192. Explain default method conflict resolution.


Core Java Interview Questions (200+)

193. What is diamond problem and how Java resolves it?

194. Difference between deep copy and shallow copy.

195. Explain System.gc() and its implications.

196. What is StringJoiner?

197. Purpose of Arrays.deepEquals.

198. Explain Spliterator.

199. What is ServiceLoader?

200. Explain try with resources.

201. What is a daemon thread?

202. Explain ThreadGroup.

203. What is platform class loader in Java 9.

204. Difference between Class.forName and loadClass.

205. Explain IllegalAccessError and IncompatibleClassChangeError.

You might also like