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

Java Interview 200 Questions Master List

The document is a comprehensive list of 200 Java interview questions categorized into seven sections: Basic Java Programming, String Programming, Array Programming, Matrix Programming, OOPs Programming, Exception & File Handling, and Collections & Advanced Java. Each section contains specific programming tasks and concepts that candidates may be asked to demonstrate or explain during interviews with major tech companies. This resource serves as a study guide for individuals preparing for Java-related job interviews.

Uploaded by

gamingrit99
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)
2 views7 pages

Java Interview 200 Questions Master List

The document is a comprehensive list of 200 Java interview questions categorized into seven sections: Basic Java Programming, String Programming, Array Programming, Matrix Programming, OOPs Programming, Exception & File Handling, and Collections & Advanced Java. Each section contains specific programming tasks and concepts that candidates may be asked to demonstrate or explain during interviews with major tech companies. This resource serves as a study guide for individuals preparing for Java-related job interviews.

Uploaded by

gamingrit99
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

JAVA INTERVIEW MASTER LIST – 200 QUESTIONS

For TCS, Infosys, Accenture, Cognizant,


Capgemini, IBM, HCL, LTIMindtree

SECTION 1: BASIC JAVA PROGRAMMING (1–30)

1. Print Hello World


2. Check even or odd
3. Find largest of two numbers
4. Find largest of three numbers
5. Swap two numbers (with temp)
6. Swap two numbers (without temp)
7. Check leap year
8. Reverse a number
9. Check palindrome number
10. Find factorial
11. Generate Fibonacci series
12. Sum of digits
13. Count digits in a number
14. Check prime number
15. Print primes between 1 to N
16. Check Armstrong number
17. GCD of two numbers
18. LCM of two numbers
19. Power of a number
20. Check perfect number
21. Check strong number
22. Print multiplication table
23. Count even and odd digits
24. Find largest digit in a number
25. Convert decimal to binary
26. Convert binary to decimal
27. Print ASCII value of character
28. Check positive, negative or zero
29. Simple calculator using switch
30. Find square and cube of number
SECTION 2: STRING PROGRAMMING (31–70)

31. Reverse a string


32. Reverse string without built-in method
33. Check palindrome string
34. Count vowels and consonants
35. Count digits and special characters
36. Count words in a string
37. Find duplicate characters
38. Remove duplicate characters
39. Find first non-repeated character
40. Find maximum occurring character
41. Check anagram strings
42. Check string contains only digits
43. Find longest word in sentence
44. Reverse each word in string
45. Find duplicate words
46. Count frequency of each word
47. Capitalize first letter of each word
48. Remove spaces from string
49. Replace character in string
50. Compare two strings without equals()
51. Check substring present or not
52. Count occurrences of substring
53. Sort characters of string
54. Check pangram string
55. Remove special characters
56. Convert string to integer
57. Convert integer to string
58. Check string rotation
59. Print all permutations of string
60. Find longest palindrome substring
61. Find smallest word in string
62. Count uppercase and lowercase letters
63. Find index of character
64. Remove vowels from string
65. Reverse string using recursion
66. Check balanced brackets
67. Count repeating characters
68. Find common characters in two strings
69. Split string without split()
70. Remove extra spaces
SECTION 3: ARRAY PROGRAMMING (71–110)

71. Find largest element in array


72. Find smallest element in array
73. Reverse an array
74. Sort array (bubble sort)
75. Sort array (selection sort)
76. Sort array (insertion sort)
77. Find duplicate elements
78. Remove duplicates from array
79. Find second largest element
80. Find second smallest element
81. Find missing number (1 to N)
82. Find frequency of elements
83. Merge two arrays
84. Find intersection of arrays
85. Find union of arrays
86. Move zeros to end
87. Rotate array left by K
88. Rotate array right by K
89. Find sum of array elements
90. Find average of array
91. Check array is sorted
92. Find common elements
93. Copy one array to another
94. Find min and max in single loop
95. Print array in spiral form
96. Find subarray with given sum
97. Find leaders in array
98. Find equilibrium index
99. Find maximum subarray sum
100. Find pair with given sum
101. Remove element from array
102. Insert element in array
103. Find kth largest element
104. Find kth smallest element
105. Sort array without built-in method
106. Reverse array using recursion
107. Count even and odd numbers
108. Find duplicates using HashSet
109. Shift all negatives to one side
110. Find longest increasing subarray
SECTION 4: MATRIX PROGRAMMING (111–125)

111. Add two matrices


112. Subtract two matrices
113. Multiply two matrices
114. Transpose of matrix
115. Check symmetric matrix
116. Check identity matrix
117. Check sparse matrix
118. Print matrix in spiral order
119. Sum of diagonal elements
120. Rotate matrix 90 degrees
121. Find row with maximum 1s
122. Search element in matrix
123. Count zeros in matrix
124. Find max element in matrix
125. Print boundary elements
SECTION 5: OOPs PROGRAMMING (126–150)

126. Demonstrate encapsulation


127. Demonstrate inheritance
128. Demonstrate method overloading
129. Demonstrate method overriding
130. Demonstrate runtime polymorphism
131. Program using abstract class
132. Program using interface
133. Multiple inheritance using interface
134. Constructor overloading
135. Use of super keyword
136. Use of this keyword
137. Static vs non-static example
138. Final keyword example
139. Create immutable class
140. Implement Singleton class
141. Association example
142. Aggregation example
143. Composition example
144. Upcasting and downcasting
145. Object cloning
146. Shallow copy vs deep copy
147. equals() and hashCode()
148. toString() override
149. Anonymous inner class
150. Lambda expression example
SECTION 6: EXCEPTION & FILE HANDLING (151–170)

151. Try-catch example


152. Multiple catch blocks
153. Finally block example
154. Checked exception example
155. Unchecked exception example
156. throw vs throws
157. Custom exception
158. Exception propagation
159. File read using FileReader
160. File write using FileWriter
161. Read file using BufferedReader
162. Write file using BufferedWriter
163. Serialization example
164. Deserialization example
165. Handle FileNotFoundException
166. Try-with-resources
167. IOException example
168. NumberFormatException example
169. NullPointerException handling
170. ArrayIndexOutOfBounds handling
SECTION 7: COLLECTIONS & ADVANCED JAVA (171–200)

171. Remove duplicates from ArrayList


172. Sort ArrayList
173. Sort ArrayList of objects
174. Compare objects using Comparable
175. Compare objects using Comparator
176. HashMap example
177. Iterate HashMap
178. Sort HashMap by key
179. Sort HashMap by value
180. Find frequency using HashMap
181. Difference between HashMap & Hashtable (code)
182. Difference between ArrayList & LinkedList (code)
183. Fail-fast vs fail-safe iterator
184. Set vs List example
185. Stack implementation
186. Queue implementation
187. PriorityQueue example
188. Thread using Thread class
189. Thread using Runnable
190. Synchronization example
191. Inter-thread communication
192. Deadlock example
193. Producer-Consumer problem
194. Volatile keyword example
195. Callable and Future
196. Java Stream API example
197. Filter and map using streams
198. Optional class example
199. Garbage collection example
200. JVM memory model example

You might also like