Java Questions
1. WJP given two array A and B find array A is a subset of B or vise versa.
2. WJP to return duplicate elements from kth distance in the given array.
3. WJP to return array of index that sum to given number K
4. int arry[] ={1,3,4,7} and k= 10
5. return [1,3]
6. WJP given 3X3 matrix return sum of diagonal and value below diagonal.
7. WJP to return given string is palindrome or not
8. Implement the multiple inheritance in Java with interface?
9. Given a string, String email="hi welcome to @[Link] your new mail is test@sc and
test@[Link]"
Write a code to return the following
valid email id's- count
invalid email id's- count
10. WJP to remove duplicates from the string
11. WJP to move all zeros to end of the array.
12. WJP to find given integer is palindrome or not.
13. what it will return //*[@class='a'] //div and //*[@class='a'] /div
14. difference between div[class=' '] P and div[class=' '] >P
15. WJP given array, print pairs equal to given sum
16. WJP to find given string is balanced or not eg: (a[s{abnbc{bbb]d)--
balanced paranthesis asds)sddf{ds}(hjj--- not balanced string
17. WJP to return array with index of first matching pair with given sum. Eg: int[] arr= {3,
5, 7,3,4,9} sum = 10 output= [0,2]
18. What are runtime exceptions?
19. What are implicit and explicit waits?
20. What are the exceptions you encountered in Java?
21. Program to find intersection of two arrays.
22. Java8 features
23. What is immutable?
24. public class TestString {
public static void main(String[] args) {
String str = "abc";
str = "xyz";
[Link](str);
}
}
25. Given Array a[] ={1,2,3,4,5,6,2}.Write Java Program to sort it.
26. What are different kinds of wait. Tell the difference.
27. What is Polymorphism?
28. Tell me about OOPS concepts.
29. WJP to reverse the word in the sentence and preserve the white space(words can have more than 1
white space in between)
30. Is multiple inheritance supported in java.
31. tell me different types of polymorphism.
32. Different types of Exceptions you came across.
33. How we get ArrayIndexOutOfBound exception?
34. How you will handle exceptions?
35. What will you use to continue and come out of the loop in java?
36. How to located dynamic data from tables?
37. Difference between HashMap and HashSet?
38. Write a string palindrome program?
39. Write a java program to check palindrome with special character.
40. Write a java program to find unique character in a string.
41. What are generics?
42. Difference between iterator and list iterator
43. What is implicit wait and explicit wait?
44. How you used java collections in your project?
45. How do you handle the exception in java?
46. Different between arraylist and array
47. What’s the purpose of non-static block and static block
48. Difference between multi-threading and multi-processing
49. Why do we go for multi-threading instead of multi-processing in java?
50. Have you encountered any deadlock threads in your framework
51. Do you know what scenarios we can encounter a deadlock thread and how can we overcome that?
52. Difference between string buffer and string builder?
53. try has code that gives null pointer exception and 1st catch has Exception argument and 2nd catch
has Null Pointer exception argument. Will my code execute ? Will it throw error?
54. Java code will be automated using Protractor?
55. Write a program to find the duplicate occurances of integer numbers?
56. Find Pair of numbers in an array equals to Sum (Using Linked List, ArrayList, HashMap) also I
57. need to explain which collections suits best for the above program.
58. How to swap two numbers without using temp variable.
59. Implement Binary search algorithm.
60. How to find occurrences of elements in an array (without using collections).
61. How to find starting index of nth element in an array which is having duplicate numbers. I need
62. to come with best approach. Also I need to explain why I used Binary search algorithm.
63. imagine there is a circular array of elements 5,7,9,0,1,3. Find the minimum element from this array?
64. What is method overloading and overriding?
65. Explain the interface concept? why we use interfaces?
66. Difference between static and dynamic?
67. What is final, finally and finalize?
68. Can a variable be final? what is the logic behind that?
69. Difference between hashmap, hashset and arraylist?
70. Create a arraylist of elements.
71. Create a hashmap
72. Coding on Arrays, Sorting technique
73. what is static and final keyword?
74. what is difference btw array and arraylist?
75. what is hashmap?
76. what does find element and findelements does?
77. What is a static method?
78. Static method can be called without an object instance. Referenced using Class name directly.
79. It can only access static variables. Generally Util classes are good candidates to have only
80. static methods. main method is another good example and it is called by JVM.
81. What is the difference between a constructor and a method?
82. what is interface
83. Have you used interface concept?
84. what is abstract class?
85. Diff b/w abstract and interface
86. What is method overloading and Method over riding?
87. d/b string buffer and string builder
88. what is the use of static keyword.
89. WJP to find max no of occurrence of a word in a string?
90. D/W Abstract and interface
91. WJP to reverse a string?
92. WJP on Binary search.
93. How to create an objet of a class
94. WJP to find a unique character from a string.
95. what is OOPS concept.
96. D/w Abstract class and interface
97. Immutable concept.
98. WJP to find the second largest no in an array.
99. What is runtime and compile time polymorphism. example.
100. what is string buffer and string builder.
101. Different ways of creating objects
102. [Link] reverse coding challenge
103. Sorting coding challenge.
104. Given Two string as input = string1 = "1231' string2 = "2342" and given a output Output = "3573
How will you find the output
105. How do you compare 2 objects in java.
106. difference between abstract and interface.
107. Collections
108. Use of collections in coding.
109. find the maximum no in given array.
110. Find substring in given string.
111. Collections hashmap and hashtree difference and wrapper class
112. Write in to text file for java code.
113. Which version of Java are you using?
114. what are the new features added in Java 8?
115. Wrapper Class?
116. What is String pool?
117. String mutable?
118. String buffer and String builder
119. Wrapper Class?
120. Difference between == and Equals for comparing String \
121. Is String is a wrapper class?No String is a Separate class
122. Program to read the contents from file and find the duplicate characters.
123. OOPS concept in Python
124. Assertions in Testng
125. Find maximum length of word in given string which is even.
126. Reverse the array without collection
127. WJP to count the no of words in a string.
128. WJP to replace some character with space without using replace method.
129. Diff b/w implicit and explicit wait?
130. java exceptions
131. java data types
132. java collections used in project
133. what is Final?
134. what is default access modifier in java class if i am not giving any public,private or java
exceptions
135. java data types
136. java collections used in project
137. what is Final?
138. what is default access modifier in java class if i am not giving any public,private or protractor.
139. Given a string move all vowels to front of the array. And implement using merge sort.
140. Debug the code now and given input string.
141. hashmap and hashtable
142. Abstract
143. and interface difference?
144. equals and hascode difference and contract b/w them?
145. Array and arraylist diffrence?
146. when you create object which method is being called internally?
147. Java program to find common elements from 2 array
148. OOPs concepts-Explain
149. HashMap Vs HashTable
150. how much memory is allocated for int a,b
151. how .class files will generate
152. what is the memory allocation for string
153. diffarence between String buffer and string
154. diffarence between string buffer and string builder
155. what are collections
156. how memory dealloaction
157. array and array list
158. explain me about try, catch and finally
159. difference between implicit wait and explicit wait
160. how do you inspect teh element
161. when will you use Byclass
162. difference between list and set, interface and abstract class,hash map,hash set
163. java code to find duplicates and remove them in java
164. explain me about try,catch and finally
165. Difference between Final,Finally,and Finalize.
166. Boxing and unboxing.
167. Collections,
168. POM Frame work,
169. Java code for rotating arrays three times?
170. Eliminate the vowels from a string?
171. WJP to print unique characters from the string
172. How you are using get method in your project?what parameters you are sending in get method.
173. diff between list and map,hashmap and hashtable,interface and abstract class,diff between
final,finally,finalize
174. WJP to check string is palindrome or not? String str=” A toYota”
175. Is strings r mutable?
Ex String a=abc
String a=xyz
what is the output
176. what is the diff between string & stringBuilder
177. write the program to pint 1 to 100 numbes in the words
178. print prime numbers 1 to 10
179. WJP to remove duplicates from string?
180. What is singleton?
181. What is Inheritance? Where do you use inheritance in your project?
182. How do you handle exception in Java? where will you use try & catch and throws in your
project?
183. WJP to Reverse the string
184. what is abstract class?
185. how will you print words from string using map
186. what is polymorphism?
187. what is method overloading and over-riding?
188. Write a java program to convert sTriNg >> StRInG