0% found this document useful (0 votes)
285 views34 pages

JAVA Study Materils

The document provides preparation materials for an interview, including: 1) Common Java questions related to collections, concurrency, OOP concepts, SQL, and algorithms. 2) Details about the interview process, which includes a 1st round online Hackerrank assessment at the medium level, followed by 2-3 technical rounds conducted face-to-face with the possibility of a 4th round. 3) Questions asked by the hiring manager during technical discussions, covering Spring, microservices, design patterns, databases, concurrency, and core Java topics.
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)
285 views34 pages

JAVA Study Materils

The document provides preparation materials for an interview, including: 1) Common Java questions related to collections, concurrency, OOP concepts, SQL, and algorithms. 2) Details about the interview process, which includes a 1st round online Hackerrank assessment at the medium level, followed by 2-3 technical rounds conducted face-to-face with the possibility of a 4th round. 3) Questions asked by the hiring manager during technical discussions, covering Spring, microservices, design patterns, databases, concurrency, and core Java topics.
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/ 34

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1st round Hackerrank: Level will be medium codechef


2nd round Face to face technical
3rd round Face to face technical
May be 4th round depends on previous rounds
HR
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Preparation Material:

1. You are using a class from a library (say Student). You have a list of Student objects.
You need to sort this list based on first name. How will you do it? Constraint: (You do
not have the ability to change the source code of the Student class)

2. Consider a class Person with two attributes - String name and List<String> degrees.
How will you make this class immutable. Ask what are the advantanges of immutable
classes

3. We have a Parent class with 2 methods walk and run. We have a child class which
overrides both the methods. Both child class methods just call their respective Super
implementation. Parent class run method calls walk(). class Parent Parent p = new
Child(); p.run(); Tell the order in which each method is called

4. What is the difference between HashMap and ConcurrentHashMap? Follow up with -


what is the difference between CHM and synchronized Map.

5. which overloaded method will be called if we pass null as the parameter

6. write an sql query to find names of all employees who are having third highest salary

7. Given a sorted integer array and a value K. find two elements from given array whose
sum will be equal to K

8. difference between fail fast and fail safe iterators

9. use of volatile keyword

10. difference between arraylist and linkedlist

11. Consider a class A with a synchronized method class A { public void synchronized
m1() {Thread.sleep(5000);} } We create two objects of this class - o1 and o2. We call
o1.m1() on one thread and o2.m1() on another thread, at the same time. What will be
the behaviour? Follow up with - how will you force these calls to execute one after
the other
12. We have a Parent class with 2 methods walk and run. We have a child class which
overrides both the methods. Both child class methods just call their respective Super
implementation. Parent class run method calls walk(). class Parent Parent p = new
Child(); p.run(); Tell the order in which each method is called

13. Given a List of integers (List<Integer>), write code in Java 8 style to get the sum of
the squares of all the odd numbers in the array.

14. What is the difference between HashMap and ConcurrentHashMap? Follow up with -
what is the difference between CHM and synchronized Map.

15. We have a table called BookAuthor. It has two columns Book and Author, Book being
unique column. Write a query to find the names of the authors who have written
more than 10 books.

16. Given an array of n integers and a number k, find the pairs of numbers in the array
such that the difference between the pair is k. Find the optimal solution with and
without extra storage

17. Can one use an Employee class as a key in a HashMap

18. Consider a class Person with two attributes - String name and List<String> degrees.
How will you make this class immutable. Ask what are the advantanges of immutable
classes

19. Consider a class A with a synchronized method class A { public void synchronized
m1() {Thread.sleep(5000);} } We create two objects of this class - o1 and o2. We call
o1.m1() on one thread and o2.m1() on another thread, at the same time. What will be
the behaviour? Follow up with - how will you force these calls to execute one after
the other

20. We have a table called BookAuthor. It has two columns Book and Author, Book being
unique column. Write a query to find the names of the authors who have written
more than 10 books.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1. What challenges you have faced Synchronization and circular dependency in


spring bean

-Observer pattern

-Instance Vs Class level synchronization


-Find k largest items

-Check if LinkedList is palindrome

-Check if words are anagrams

-SQL: find employees with max salary in each dept Print employee name and
manager name

3. How hash map work internally.

4. How to design efficient hash code in production code?

5. R1: project explain

6. Oops concept

7. design pattern

8. intrinsic and extrinsic lock

9. wait notify

10. how internally wait works

11. synchronization puzzle

12. out of memory diagnosis

13. countsdownlatch vs cyclic barrier

14. cyclic barrier, print even odd using 2 threads

15. Basics of String pool constant, why we use that where it is in main memory

16. Diff between jdbc and jpa

17. 3rd round - manegerial , java 8 , stram api, spring boot rest api

18. spring ioc container

19. microservices concept

20. LinkedList implementation

21. cache implementation


22. immutable class

23. HashMap equal and override

24. abstract class and interfaces

25. encapsulation vs abstraction

26. checked exception vs unchecked exception

27. deadlock prevention techniques

28. How will you design a class to use that class as key in HashMap?

29. Will 3.01 == 3*0.01 return true or false?

30. What is memory leak and write a program for memory leak

31. How much you rate yourself in java

32. Find element in rotated array.

33. Hash code and equals contract and detailed into it

34. Why we create setter getter in pojo classes.

35. Garbage collects.

36. Basics of Java polymorphism,

37. inheritance and abstraction

38. Singleton class, immutability

39. threads can we start the same thread twice

40. how to maintain a pool of threads

41. synchronized keyboard

42. final keyword

43. exception handling.

44. When we call wait method which class method is called and How its release
lock.
45. What challenge you are looking for in future

46. Basic java core HashMap and hash set and tree map usages

47. Explain Immutability and its advantages and immutable classes in java.

48. Explain overriding and why it is required.

49. Multithreading thread pool

50. Three threads are there. First prints continuously 1, while second and third
prints 2 and 3 respectively. How will you synchronize them to print 1,2,3
sequentially and efficiently?

51. Concurrent hash map

52. Detail about project in fact complete 3 years what I have done which project
worked on what was role

53. You have a thread and I want to return a value to the main thread how do u do
that. This was basically about thread pool executor callable and future

54. What is volatile in Java?

55. Given a tree with elements as 1->2&3 and 2->4&5 and 3->6&7. So now a
child tree is given. Write a function to check whether the child tree is a subtree
or not. Also try to optimize it.and he asked what the time complexity of the
method is proposed by me.how I deduce the complexity. Which order
transversal of the tree will it be good

56. software design patterns

57. what is factory, abstract factory, builder, singleton and composite patterns

58. Difference between abstract factory and factory

59. Use of builder and implementations

60. What is difference between synchronized block or synchronized method

61. How one thread can take two object lock. What is it role?

62. Comparable and comparators-based question. like you have employee object
and you are adding it to a collection how u make sure the employees will be
added in sorting order with their id, id and name, what if designation is there
and I want CEO Olin 1st in the list and other employees as per sorting order
with id

63. Which data structure set uses

64. Race condition

65. Basic definitions about different frameworks, uses of trending libraries and
project related details

66. What will happen if class is mutable and used as key in HashMap.

67. Employee object added into hash map and then Id of the employee changed
what will happen. this was basically related to mutable key in hash map

68. Reentrant lock

69. How treeset make sure the element is in sorting order

70. Overloading and overriding and what will happen if you override a method
and change in exception throws

71. How to make singleton detailed discussion on it like how to make thread safe
etc

72. Set uses which data structure

73. What is contract of hash code and equals

74. You have student object and the stream of student coming in you don't know
how many very large numbers can be if u only must read which collection do u
use

75. finally block

76. What will be consequence of writing return stmt in finally block

77. How to create a mutable class?

78. How to create a immutable class?

79. - Difference between throw and throws

80. - Difference between final, finally and finalize


81. - Super class throws IO Exception and sub class throws
FileNotFoundException. What kind of error will it give? And vice-versa

82. - Difference between spring boot and spring

83. - Use of @MappedSupperclass

84. - How to implement many to many mapping in a relational database?

85. - How to handle many to many mappings in hibernate?

86. - Uses of AOP and some other related questions??

87. - How to manage connections to multiple databases in a single application?

88. - The name of the annotation that specifies which implementation to use at
runtime out of many

89. : What is difference between == and. equals method

90. What if u must search the element than which collection to use

91. call method return type

92. Hash table internal data structures

93. : How can you synchronize a block of code in constructor.

94. : How will you design a class to use that class as key in hash map.

95. Caching data from database

96. modified scenario of your project

97. m1,m2,m3 are synchronised, static synchronised and not


synchronised-behaviour of threads in this scenario

98. What if u must store unique student which data structure to use

99. Producer consumer problem with and without wait notify

100. Consumer Producer problem in multithreading

101. : Blocking queue

102. : Composition and aggregation


103. : A couple of coding problems

104. : Constructor can be synchronized

105. : What is difference btw hash set and array list

106. : What is difference between interface and abstract class

107. : Synchronization

108. : Starting with the project Complete in detail

109. Draw architecture diagram of the current project as well

110. diff between jdk jre jvm

111. Java 7 try with resources

112. Try throwing filenotfound and other unknown exceptions then print file not
found or general exception

113. Clone methods in detail

114. Advantage of array list over linked list

115. How much you rate yourself in java

116. Load balancing

117. Executors and Executor service.

118. Servlet.

119. When we should use it.

If we have I millions of records and we need to search. Then which data structures will
use, hash set and array list

120. Auto complete

121. Inheritance and composition, when to use what.

122. Java script data type

123. object in Java script


124. class in Java script

125. alternative of wait notifies and notify all

126. Use case of Multithreading: parallel reading of file using multiple threads.

127. Web service soap and rest.

128. Implementation function ability to execute 3 thread sequentially

129. Diff between HashMap and Concurrent Hash Map

130. With every question he will, real-time example or how you are using in your
project.

131. Spring scope prototype vs singleton. Which do you use your project and
why?

132. Thread pool vs executor service.

133. Submit vs execute method.

134. Thread dump. How to analyses.

135. Tim complexities of HashMap

136. HashMap and Concurrent Hash Map internal working??

137. Internal working of HashSet and Linked HashMap.

138. Linear chaining vs quadratic probing??

139. Multithreading: Volatile, atomic variable, cyclic and countdown latch, livelock

140. What will happen if class is mutable and used as key in hash map

141. Time complexities of hash map.

142. Scheduled executed service

143. Linked HashMap

144. Difference between hash table and concurrent HashMap

145. Exception Handling


146. Collection Framework (HashMap, Tree map, Concurrent HashMap)

147. Immutable Class, String pool constant,

148. Multithreading: wait & notify, synchronization.

149. Time complexity in Data structure.

150. He may ask if there is any possibility of optimization in code.

151. 6. Fill color for a given shape on canvas.

152. : Why to use kafka?

153. What is kafka topic and partitions?

154. About Retry mechanism in kafka message consumption.

155. What Couchbase was used in my earlier project.

156. More tools related questions, for tools which were mentioned in CV.

157. More questions about the things which were mentioned in CV.

158. Different between different REST annotations.

159. To implement one simple REST Endpoint.

160. Exact behavior of HashMap methods.

161. Custom implementation of HashMap's get and put method.

162. Role of immutability of object being used as HashMap key.

163. Implementing a production ready method for factorial calculation, later


enhancing the performance in different ways.

164. Best and worst case?? What are those cases??

165. JVM internal memory

166. What is a thread dump?? How to debug using a thread dump??

167. What is memory leak and write a program for memory leak

168. What challenge you are looking for in future


169. Something related to right Ur own Multimap

170. Employee object added into hash map and then Id of the employee changed
what will happen. this was basically related to mutable key in hash map

171. What challenges you have faced

172. how one thread can take two object lock.

173. Overloading and overriding and what will happen if you override a method
and change in exception throws

174. What is a thread dump?? How to debug using a thread dump??

175. Which data structure set uses

176. Garbage collector.

177. Immutability and its advantages and immutable classes in java.

178. Explain overriding and why it is required.

179. How treeset make sure the element is in sorting order

180. How hashmap works

181. Blocking queue

182. How to make singleton detailed discussion on it like how to make thread safe
etc

183. What is difference between == and .equals method

184. Builder design pattern

185. What if u must store unique student which ds to use

186. - Super class throws IOException and sub class throws


FileNotFoundException. What kind of error will it give? And vice-versa

187. - Difference between spring boot and spring

188. - Use of @MappedSupperclass

189. - How to implement many to many mapping in a relational database?


190. - How to handle many to many mappings in hibernate?

191. - Uses of AOP and some other related questions??

192. - How to manage connections to multiple databases in a single application?

193. - The name of the annotation that specifies which implementation to use at
runtime out of many

194. Detect a loop and remove it from linked list

195. Composition and aggregation

196. She also asked about software design patterns

197. - what is factory, abstract factory, builder, singleton and composite patterns

198. - Difference between abstract factory and factory

199. - Use of builder and implementations, what is it role

200. Producer and consumer problem with and without wait notify

201. m1,m2,m3 are synchronized, static synchronized and not


synchronised-behaviour of threads in this scenario

202. What if u must store unique student which ds to use

203. How will you design a class to use that class as key in hashmap .

204. You have a thread and I want to return a value to the main thread how do
you do that. This was basically about thread pool executor callable and future

205. How treeset make sure the element is in sorting order

206. Call method return type

207. Hashtable internal data structures

208. Treemap problem

209. Immutable class

210. Print 1 2 3 with three threads

211. How HashMap works


212. How to make singleton detailed discussion on it like how to make thread safe
etc

213. Try throwing filenotfound and other unknown exceptions then print file not
found or general exception

214. Clone methods in detail

215. Advantage of array list over linked list

216. Overloading and overriding and what will happen if you override a method
and change in exception throws

217. Immutability and its advantages and immutable classes in java.

218. Explain overriding and why it is required.

219. What if u must search the element than which collection to use

220. What is memory leak and write a program for memory leak

221. Spring scope prototype vs singleton. Which do you use your project and
why?

222. Web service soap and rest.

223. How can you synchronize a block of code in constructor?

224. Auto wiring

225. use case of Multi-threading

226. use collection to store data, if already present return false, not present
added, and give sorted order data

227. Internal working of TreeSet

228. Why need to override compareTo method.

229. Internal logic to compare String object, on that compareTo work.

230. why String object has special preference to store data in String constant
pool?

231. Time complexity of hash map and tree map


232. Which data structure used by Tree Map in Java?

233. What is volatile keyword and what will be the output of a variable if two
thread increments shared variable from 0 to 10 and print

234. There is a function which every time returns random number. You are calling
this function in infinite loop for an hour. How will you get top largest 1lac
integers from these calls?

235. There is a Student class, it has 20 attributes, there are 1 billion rows in
memory for this Student class.

There is another object of a Student class and I want to check if this object exists
in the list of 1 billion rows. It should match all 20 attributes for object to be
equal. How will you do this in Java

236. Why should we write notify method call at the end of synchronized block?

237. What is spinlock?

238. Which sorting algorithm used by Java?

239. TreeMap working

240. Overriding principles

241. what if key is changed, what will happen to value

242. Overloading/Overriding parent child questions

243. private method overriding

244. static method hiding

245. How to decide no of threads in executor service

246. How to handle multiple request

247. HashMap sorting based on value. Also using java8

248. Drill into oops concepts

- polymorphism

- constructor chaining
- object creation and it's life on JVM

- Java memory model

249. Design of current project including interfaces, classes. Design patterns used
in the project. How will you manager delivery and technical challenges
together. Grooming of juniors. Design something like twitter, Facebook, trading
platform.

250. Object oriented programming principles.

251. Explain your current project.

252. soft hard phantom references

253. Concurrent access of HashMap, how to provide thread safety

254. Mostly he may focus on project which candidate might have done and he
may ask what kind of issues candidate faced while working on project.... like
any technical issues and how he deals with that.

255. project architecture related questions

256. Micro-service concept

257. Garbage Collection

258. Between dispatch servlet and filter who will get first request

259. String pool related questions

260. File io in java

261. Executive Service internal implementation

262. Selection sort

263. Rules for method overriding

264. Rules for method overloading

265. With every question he will, real-time example or how you are using in your
project.

266. alternative of wait notifies and notify all


267. parallel reading of file using multiple threads.

268. If we have I millions of records and we need to be searching.

269. Then which data structures will use, hash set and array list

270. How we handle runtime exception in data base.

271. Replace key with value in a hash map

272. What are solid principles

273. Difference between encapsulation and data hiding

274. Java 8 features

275. One thread increases counter second thread get notification

276. Annotations in SpringMVC and how to set http status codes in response?

277. what all functionality needs to be provided by system? and How


implementation will be done. (Controller, service, model classes.)

278. Outofmemoryerror how to resolve

279. What are solid principles

280. : Lambda expression in java

281. Difference between wait and sleep

282. What is Volatile in java.

283. software design patterns

- what is factory, abstract factory, builder, singleton and composite patterns

- Difference between abstract factory and factory

- Use of builder

- and implementations

284. What if u must search the element than which collection to use

285. call method return type


286. Caching data from database

287. Difference bet Hash set and Array List

288. Constructor can be synchronized.

289. Which data structure set uses

290. Submit vs execute method.

291. Replace key with value in a HashMap

292. Streams

293. All concurrent latches.

294. Why to use double hashing in HashMap

295. What is the purpose to use key of a HashMap as immutable?

296. How to make class immutable and why we use final prefix to instance
variables

297. Concurrent modification exception

298. Outofmemoryerror how to resolve

299. Hash tree internal working. (hashing, hashing collision, hash code() and
equals())

300. Annotations in SpringMVC and how to set http status codes in response?

301. Work done by me in my project and what improvements i will suggest in


that?

302. Between dispatch servlet and filter who will get first request

303. File IO in java

304. How to design HA server with sticky session (pseudo logic)

305. -How to read large file with memory constraints

306. -How to sort large file with memory constraints

307. Parent child relationship while object creation


308. JVM architecture

309. Immutable key in HashMap

310. Spring boot

311. Spring transaction

312. Spring batch

313. Microservices

314. Diff between abstract class and interface

315. Print numbers from 1 to 20 using two threads

316. Java 8 features - optional, stream

317. Executor framework - implementation and usage

318. What is the most challenging task u have done in last three months?

319. Synchronized vs Reentrant

320. Concurrent access of HashMap, how to provide thread safety

321. HashMap vs hash table

322. Collections framework hierarchy

323. Iterator

324. CopyOnWriteArrayList

325. What do you know in UI? HTML, JS, jQuery, CSS, Angular?

326. 1.Why java didn’t provide sorted Array List

327. 2.How HashMap calculate Index of bucket?

328. 3.How to connect Data base in Spring Boot

329. 4.SOLID Design Principle

330. 5.Java Memory management


331. 6.Why Out of Memory Error is come? how to resolve this

332. 7. Stack full Memory Error

333. 8.What is dependency Injection in Spring

334. 9.Project Architecture in Depth

335. How you write API in Spring? What all sequence of steps you will take?

336. Spring: bean scopes, auto wiring

337. Fill the table with Yes/No and explain why it is yes/no.

Public Default Protected Private Final


Static

Class

Interface

Abstract Class

Method

Local Variable

Instance Variable

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1. System Design

1.flood fill 2.web crawler

2. Give use case and finding word combination from given dictionary

3. logical question to solve a problem of Lego where multiple shapes were given as
input, we need to give the count of each shape. the shape can be rotated.

4. problem statement for solving a question where we have 2 files feed and we need
to find out which records are only in left file or only in right file or if present in both
then which identify which is having higher value left or right.

5. Detect a loop and remove it from LinkedList


6. Implement Double link list.

7. Lru cache

8. design pattern composition design pattern.

9. implement re-try logic in activity kind of requirements.

10. design coffee shape.

11. design employee directory system.

12. top n’th most occurred name in file.

13. SEAT Booking logic

14. Word given eat and find ate tea like all possible word from dictionary

15. Function to take two strings as arguments and then find whether first is
permutations of other or not.

16. Link list problem

17. Trie data structures problem

18. Trading system he has given a scenario in that there are multiple company and
price are getting populated. please design a data structures to store this

19. Design a coffee shop system

20. Builder design pattern

21. Tree map problem

22. Immutable class

23. Print 1 2 3 with three threads

24. : Lots of small small output questions related to Java - Linked hash map

25. : Find duplicate in two arrays in o(n)

26. You have a linked list given with value into it a1, a2, a3, b1, b2, b3, Create new
list with value a1, b1, a2, b2, a3, b3

27. Link list reverse using recursion


28. Given an array with number 1 to 100 and 2 number is missing.

29. Find element in rotated sorted array

30. Design a coffee shop system

31. Find 2 misplaced elements in a BST.

32. Design a system to process large files?? For e.g. 20 GB files.

33. find the missing element from sorted array

34. we have a huge file containing positive and negative numbers. Get the
summation of those numbers and explain the process and problems faced while
processing.

35. In a sorted array of n-1 elements. Which contains all numbers up to n except
1??Find the missing number?

36. Design tinyURL service

37. Design a connection pool

38. Array program to sort 0 1 and 2

39. Prob on finding a not b on two list.

40. Replace key with value in a HashMap

41. Program to find pair with sum equal to value.

42. Remove n'th node from singly linked list.

43. Design collection to find minimum cost of buying n items.

44. Binary search

45. Given a array with number 1 to 100 and 2 number is missing

46. In a sorted array of n-1 elements. Which contains all numbers unto n except
1??Find the missing number??

47. Quick sort


48. Function to take two strings as arguments and then find whether first is
permutations of other or not.

49. Designing....If you have 4 3d printers. we will get jobs with a input how much
time it will to take print.... what will be the design? What all classes will be
their...what all data structure u will use.

50. Link list reverse using recursion

51. : Find duplicate in two arrays in o(n)

52. You have student object and the stream of student coming in you don't know
how many very large numbers can be if u only must read which collection do u
use

53. Write a program to count the number of times a substring occurred in each string

54. binary search recursive method

55. insert a new node in a binary tree

56. design a traffic signal.

57. given an array, write code to print another array which include the product of all
the other numbers in the array except the number at the index (without using
divide) eg: [1,2,3,4] -> [24,12,8,6]

58. given a number write it in words. 123 -> one hundred twenty-three

59. implement a queue using stack

60. Print natural numbers till 20 using 2 threads, 1 thread for odd number and 1
thread for even numbers. (Thread communication).

61. Check whether a tree is binary search tree.

62. Reverse a Linked List.

63. Read millions of orders(Order_Id, Order_Time) from a file and output the order
ids within given time window(Start date and end date). Write test cases.

64. Code to find smallest number in rotated array

65. Code to find number of employees working under them with data being in
Map<String, String>
66. Code to find out year with highest living population where data given is year
wise birthcount and deathcount

67. Class A{

Public void method()

}}

Class B Extends A{

Public void method()

}}

Case 1: both class not throwing exception

Case 2: Class A throws IO exception.

Case 3: class B throws IO exceotion

Case 4: class B throws FileNotFoundException.

Case 5: swap exception, class A method throws fileNotFundException and Class B


throws IO exception.

Case 6: class B throws any Runtime Exception

68. Main method{

Integer a=5;

Fun(a:

Sop(a);
}

Public void fun(Integer a){

A=4

What is value of A , printed in class main

69. Its compiled or not?

PSVM(

Try{

Sop(fun();

}catch(Exception e){

Sop(“error”)

)}

Public void fun(){

Try{

Return 4;

}catch{exception e}{

System.exit(0);

}
}}

// output

70. Design parking lot

71. Count one string occurrence in another string

72. Write a program to count the number of times a substring occurred in each string

73. Design of a hotel booking system

74. We have a huge file containing positive and negative numbers. Get the
summation of those numbers and explain the process and problems faced while
processing.

75. Given array of numbers [5,10,15,20,25...] create another array which is product
of all elements in the array itself except the element at the position

76. find the middle element in a linked list.

77. find the first repeating character in a string and print its previous and repeated
index.

78. How to design HA server with sticky session (pseudo logic)

79. How to read large file with memory constraints

80. Write a logic to fill color on this image

81. array of numbers given, find all pairs which makes sum k. Numbers can be +/-,
duplicates, one no can be used only once in pairs Send same files to multiple
client and wait until all client acknowledge and then process based on ack. How
main thread can wait and proceed further once client ack.

82. Say there is a new page in paint, and you draw multiple lines

: How will you design a code to decide which are should get filled with which color

: You can take a two-dimensional array and each cell in array say has a object with a
value color as white color
: When you click on position and fill color it will only fill the enclosed area with the
line

83. Print natural numbers till 20 using 2 threads, 1 thread for odd number and 1
thread for even numbers. (Thread communication).

84. Check whether a tree is binary search tree.

85. Reverse a Linked List.

86. Read millions of orders (Order_Id, Order_Time) from a file and output the order
ids within given time window (Start date and end date). Write test cases.

87. Fill color for a given shape on canvas.

88. Design of current project including interfaces, classes. Design patterns used in
the project. How will you manager delivery and technical challenges together.
Grooming of juniors. Design something like twitter, Facebook, trading platform.

89. Reverse string using recursion.

90. Sum of sub array optimize solution.

91. Stack data structures

92. Implement stack

93. How will you implement a cancel button in mobile video player when a 10 gb
movie is getting played in a phone with 2 gb ram? (using volatile keyword)

94. write a class and method using generics with proper syntax.

95. minimum number of jumps required to reach the end of array

https://www.geeksforgeeks.org/minimum-number-of-jumps-to-reach-end-of-a-given-
array/

96. Stock buy sell max profit problem

97. Design collection to find minimum cost of buying n items.

98. we have a huge file containing positive and negative numbers. Get the
summation of those numbers and explain the process and problems faced while
processing.
99. Make the all elements equal for given array of integers using certain number of
options.

100. Delete the inbound nodes from given acyclic directed graph.

101. Design the distributed multi-threaded model to pick and updated the process
based in their execution status, write the API code as well.

102. Get winners from array input.

1,4,8,5,4

Then 4.

Coz 4 arrive two time

3,6,2,15,1

Then 3

Coz every element arrives only once. And 3 is first arrived.

10,5,7,5,1,10

Then 5

Coz 5 is first completing task based on arrival

103. Given an integer array and a sum variable need to find the pair with sum equal
to sum variable in best time complexity

104. Design an ATM system

105. Design the Amazon product search feature. Millions of products. Filter on
multiple properties such as colors, price, size, etc.

106. Find 1st duplicate letter and it's all occurrences in each string.

107. Find middle element of a linked list


108. Create a data structure where add, get and delete in order of 1 with natural
ordering

109. Need to write solution along with junit test cases.

Problem statement: there are n new developers named 1,2,..N. So a pool of total N
developers.

there are two leads named 'A' and 'B'

A will give his preference of developers needed for his team in high priority to low
priority order. EX: [3,4,1,2,6,7]

B will also give his preference of developers needed for his team in high priority to
low priority order. EX: [1,4,3,2,6,7]

Now selection process goes like A gets chance to pick developers from available
pool and then B gets chance to pick among available. This process goes on until no
developers left.

110. How to identify top 5 most repeated words in a file?

111. Discussion on low level design of an airport which has many takeoffs and
landings and has only one airstrip or runway

112. WAP to find the diameter of a binary tree

113. Height of tree. Print longest path of a tree

114. Transpose of a matrix data structure question

115. If we call java Account using two putty with the same machine IP address, then
how many jvm will start where Account is the class name that stored on the
machine in compiled format I.e. Account. Class

116. Peak point in rotational array.

117. Given a tree with elements as 1->2&3 and 2->4&5 and 3->6&7. So now a child
tree is given. Write a function to check whether the child tree is a subtree or not.
Also try to optimize it. and he asked what the time complexity of the method is
proposed by me. how I deduce the complexity. Which order transversal of the
tree will it be good
118. You have student object and the stream of student coming in you don't know
how many very large numbers can be if u only must read which collection do u
use.

119. we have a huge file containing positive and negative numbers. Get the
summation of those numbers and explain the process and problems faced while
processing.

120. Design collection to find minimum cost of buying n items.

121. Count one string occurrence in another string

122. Discussion on low level design of an airport which has many takeoffs and
landings and has only one airstrip or runway

123. Minimum number of jumps to reach end ???????? check In GFG

124. Scenario based on concurrent modifications exception

125. Sum Tree Problem

126. Need to write solution along with junit test cases.

Problem statement: there are n new developers named 1,2,..N. So a pool of total N
developers.

there are two leads named 'A' and 'B'

A will give his preference of developers needed for his team in high priority to low
priority order. EX: [3,4,1,2,6,7]

B will also give his preference of developers needed for his team in high priority to
low priority order. EX: [1,4,3,2,6,7]

Now selection process goes like A gets chance to pick developers from available
pool and then B gets chance to pick among available. This process goes on until no
developers left.

127. Design of a hotel booking system

different tables having different capacities.

what all functionality needs to be provided by system? and How implementation will
be done. (Controller, service, model classes.)
128. How to identify top 5 most repeated words in a file?

129. Create a data structure where add, get and delete in order of 1 with natural
ordering

130. How will you implement a cancel button in mobile video player when a 10 gb
movie is getting played in a phone with 2 gb ram? (using volatile keyword)

131. write a class and method using generics with proper syntax.

132. Sum of sub array optimize solution.

133. Stack data structures

134. Implement stack

135. we have bank transactions in a flat file with name, type(v buy/sell), amount.

136. we need to give gift vouchers for all transactions exceeding rs. 10,000. also
consider pair of transactions which are exceeding 10,000. Make sure to give
maximum number of gift vouchers.

137. How will you design a code to decide which are should get filled with which
color

138. Say there is a new page in paint, and you draw multiple lines

139. Java - Design of current project including interfaces, classes. Design patterns
used in the project. How will you manager delivery and technical challenges
together. Grooming of juniors. Design something like twitter, Facebook, trading
platform

140. Sort an array that contains 0s and 1s

141. When user A requests their all bags to be infornt of the queue

Like if there are A, B, C, B, D, A, E, B,B,E are bags in a queue on a conveyor belt

All bags will a tag also with class line class Bags {String tagName;String Owner;}

Then output queue should be A, A, B, C,B,E,B,B,E

142. 3rd round there were scenario-based questions on my current project like how
did I read large number of jobs from database to perform operation on that like
which data structures i used.
143. One problem solving to find max subarray length having sum of that sub array
elements to 0 (zero) in an array having random positive and negative integers

144. Time complexity in Data structure.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1. Query to print 3 highest paid employees from table without using sql functions
in efficient way.

2. find nth heights salary dept wise.

th
3. 100 highest salary in employee table

4. indexes and index type

5. Database query to fetch the person name whose hobby is not reading

6. View and store procedure.

7. Why we need view in data base.

8. How we handle runtime exception in data base.

9. Transaction in database

10. Caching with view.

11. Cleanup of database resources.

12. Group by pivot

13. Given two tables employee and department. Find max salary from employee
table based on department.

14. delete duplicate rows in a table

15. Caching data from database

16. Difference Between merge and persist

17. Sql query to get employee records having salary greater than average salary

18. Sql query to get second highest salary


19. Write a query to get all the employees who directly or indirectly reports to an
employee and also tell how it stores in java

20. query to print department name and count of persons in each department?

persons table. (has columns personid, person name, departmentid)

department table (has columns departmentid, department name)

we can have persons who does not belong to any department

we can have departments where there no persons

21. How index works in database

22. How to store m*n matrix in rdbms. (Table design)

23. DB optimization

24. Data base connectivity in jdbc and hibernate

25. Entity Manager works.

26. Find all the employees who has manager sql query

27. Db table transformation

28. different tables having different capacities

29. How we handel runtim exception in data base.

30. Design a connection pool

31. Delete duplicate rows write sql query

32. Write a query to get all the employees who directly or indirectly reports to an
employee and also tell how it stores in java

33. How database indexes work internally

34. write Oracle SQL query

persons table. (has columns personid, personname, departmentid)

department table (has columns departmentid, departmentname)


we can have persons who doesnot belong to any department

we can have departments where there no persons

query to print departmentname and count of persons in each department?

35. Client data management team. Lot of technologies. Database Matlab.

36. There are 2 tables A and B, both has 2 columns id and name. How will you
find data which is not common in both table?

37. What is cross join?

38. How to optimize query running slow in production?

39. How to check if your index is used or not?

40. How to find list of departments from employee table for which all employee of
that department has same salary

41. DB - Joins (left outer join), Indexes, Query plans, Query optimization.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

https://kupdf.net/download/cracking-core-java-interviews-munish-chandel_58fcadffdc0d60ae279
59eec_pdf

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1. Multithreading/JVM/Garbage-collector ->
https://www.youtube.com/c/DefogTech/featured
2. SQL ->
https://www.youtube.com/playlist?list=PL6n9fhu94yhXcztdLO7i6mdyaegC8CJwR
3. Microservices ->
https://www.amazon.in/Cracking-Spring-Microservices-Interviews-developers-ebook/dp/
B07B4H3VZ9
4. Java-Interview-Questions ->
https://www.amazon.in/Cracking-Core-Java-Interviews-3rd-ebook/dp/B07BD3HB3Q/ref=
sr_1_2?dchild=1&qid=1602927449&refinements=p_27%3AMunish+Chandel&s=digital-t
ext&sr=1-2
5. Problem Solving -> a. Array -> https://www.geeksforgeeks.org/array-data-structure/
b. Strings -> https://www.geeksforgeeks.org/string-data-structure/
c. Trees -> https://www.geeksforgeeks.org/binary-tree-data-structure/
d. Graph -> https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

You might also like