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

Java Questions

The document contains a comprehensive list of Java programming questions and tasks, covering various topics such as database operations, game development, API interactions, data structures, algorithms, and multithreading. It includes requests for code implementations, explanations of concepts, and pseudocode for specific scenarios. The questions are aimed at assessing knowledge and skills in Java programming and software development practices.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Java Questions

The document contains a comprehensive list of Java programming questions and tasks, covering various topics such as database operations, game development, API interactions, data structures, algorithms, and multithreading. It includes requests for code implementations, explanations of concepts, and pseudocode for specific scenarios. The questions are aimed at assessing knowledge and skills in Java programming and software development practices.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Java Questions

1. You have a Vendor class with id, name, and other fields. Write a Java
program to insert data into a database, but before insertion, check if
the record already exists. If it does, update the existing record;
otherwise, insert a new one. explain approach and write Sudo code.
2. Write java program for rock, paper, scissor game.
3. Explain rest template.
4. Explain web client.
5. Write java program to find duplicate elements in an array.
6. Write java program to find the diagonal sum of 3*3 matrix.
7. Write java program to find largest element in each column and each
row in 3*3 matrix.
8. Write java program to print Fibonacci series.
9. Write java program to count the occurrence of names in given string
array.
10. Write java program to find the length of longest sub string
without repeated characters.
11. There is an array of uncertain duplicate integers in an array.
Write java program to print second largest element in array without
using data-structure, use only brute force.
12. There is an array of uncertain duplicate integers in an array.
Write java program to print second largest element in array without
using data-structure, use only brute force, use single for loop.
13. Write java program to call rest API from another rest API using
rest template.
14. Write java program to call rest API from another rest API
without using rest template.
15. Difference between spring and spring boot. How will you
identify which is spring application and which one is spring boot
application.
16. What is language binding?
17. What is Internationalization?
18. What is load balancing?
19. How to map java objects with backend data.
20. Where will you define the database connection details in java
application.
21. Write java program to reverse the given string.
22. Write java program to find the min and max elements in an
array.
23. Write java program to find the highest average of a student in
2D array. Example: String [ ] [ ] student = Input: [{"Murali","86"},
{"Krishna", "36"},{"Raju", "51"}, {"Anil","37"}, {"Krishna", "55"},
{"Lakshmi", "98"}]
24. Explain microservice architecture.
25. How restful API invoke in spring architecture.
26. Explain deadlock concept in java multithreading and write
pseudocode.
27. How will you handle the exceptions in java?
28. Explain stream API use in Java8.
29. Write java program to sort the person by age using stream
where people class have name, age as fields.
30. Write a pseudocode for log routing program that prints the
last 5 days' files and moves the rest to an archive directory in Java.
31. Write java program to check the given string is palindrome or
not using streams.
32. Write java program to check the given string is palindrome or
not without using streams.
33. Explain API workflow.
34. How to recover thread dump issues and out of memory
errors.
35. Consider there is an production issue, you know where we
need to changed the code to fix the issue. Whether will you just
compile that single file as jar or whole application?
36. What is the tool being used to check the Application health?
37. How would you troubleshoot a situation where some users can
access a web application, but others cannot.
38. Write java program to find the length of longest uniform
substring in a given string and starting index of substring.
39. Application is down; how would you approach?
40. An application suddenly stops working after a recent update.
What steps would you take to identify and resolve the issue?
41. Describe a situation where you had to troubleshoot a Java
application issue using log files. What was your approach, and what
tools did you use?
42. A Java application build is failing in the CI/CD pipeline. How
would you troubleshoot and resolve the issue?
43. You discover a security vulnerability in a Java application. How
would you go about fixing it and ensuring the application remains
secure?
44. What is null pointer exception? Why it will occur and write a
simple java code that will throw null pointer exception.
45. Write java program to find given char[] array is palindrome or
not. If palindrome then form the palindrome.
46. Write java program ro find the missing numbers in an array
without sorting.
47. Write java program to find second largest and second smallest
number in an given array.
48. Write a java program where you have to read data from a text file which is
coming in a delimited format like %. This needs to be read and stored in
database backend table. Give the approach and then the code.
49. Write a java program that takes two integer arrays and
compare them with 1st index of the 1st array to the last index of the
2nd array and so on. Store the larger element in the 3 rd array and
return it.
50. A 2D array of intervals, where each interval is represented as
a pair of integers [start, end]. Write program to merge all
overlapping intervals and return a new list of merged intervals.
51. How would you map the columns that are there in a file to the
columns in a backend database table when loading data?
52. Suppose you receive a data feed called trade, which contains
trade records that need to be uploaded into a trade table in the
backend. How would you design a Java program to do this?
53. What are some important Java libraries you would use for
writing above kind of program?
54. Write Java program to find the ovals in the given string?
55. Can objects be stored in array?
56. Difference between array and arrayList.
57. Given a log file, and each line starts with an ip address, write
java program return the ip address which accesses the site most
often.
58. What is collections?
59. Difference between HashMap and HashSet.
60. What is Hash collision and how it is handled.
61. what is JDBC and how do you connect?
62. Difference between soap and rest.
63. What is exception?
64. What ara the default values of int and string?
65. Use of try catch.
66. Can we use try without catch.
67. Explain final, finally and finalize.
68. what is error and what is the difference btw exception and
error?
69. What is multithreading?
70. What is stack overflow?
71. Write program to find the first and last non-repeating
character in given string.
72. Difference between HashMap and Concurrent HashMap.
73. Difference between ArrayList and LinkedList.
74. Explain the annotation that are frequently used in your spring
boot application.

75. Java program to implement binary search and explain the


approach.
76. If there is a null pointer exception occurred, What is my
approach to debug this?
77. Write program to find all the missing alphabets in the given
sentence , test cases include upper-case and lower-case alphabets.
78. Write java program to print max sum of the array without
adding the consecutive elements .
79. Explain java 8 features.
80. Difference between iterator and Iterable explain with code example.
81. What is static explain with example.
82. What are the ci/cd tools you have used.
83. Explain String framework.
84. Write a program using iterator and loop the List of values and print in iterator
loop.
85. Write program to find the best average grade of given a list of
student test scores. Each student may have more than one test
score in the list. Test score may be positive or negative integers.
86. What is connection pooling.
87. How do you connect multiple DB's?
88. Write a java code to retrieve data from database.
89. How will you read large files.
90. How will you handle exceptions in your application.
91. how do you set size of the heap?
92. Difference between == and .equals() .
93. Explain JVM and garbage collection.
94. Difference between put and post methods.
95. Can we delete data using put.
96. Write java program to reverse string with reverse method and
using for loop.
97. Write program to swap two numbers without using third
variable.
98. What are the steps to develop an API.
99. Write program to find the highest marks in 2D array with
name and marks.
Write java program to show occurrence of characters in a string in
below format. Example: Input String = “aaaabccddddd”
Expected Output -> a4b1c2d5
100. Write program to sort an array using any sorting algorithm.
101. Write program to fins the second non-repeating character in a
string.
102. Explain OOPS concept.
103. Difference between interface and abstraction.
104. Types of memory in java.
105. What is volatile keyword?
106. What happens when you write [Link](), How it works
internally?
107. Can Garbage Collection delay query output?
108. What is wrapper class in java?
109. Write a snippet code keeping sensitive data like passwords
secure?
110. Log file throw null pointer exception write java program to
read the log file and how many null pointer will thrown they process
name with londan stock and count them.
111. Write program to print the element which having occurrence 3
times in given array.
112. Given a scenario where we have to code keeping one
substring In a coder pad link they had given a logic to build
Scenario: Person ram has permutation of A,B,C,D-> 4 distinct values
Where if ABC String appears as an input parameter the length needs
to be decreased to 1 . else we need to print the length of the
ingredients taken Testcase 1 -> abcdabce -> 8
Testcase 2 ->abcabce->5 // original length
113. Deadlock why it happens? How to resolve?
114. Use of reentrant lock? Why how it is effective compared to
synchronized.?
115. How can we improve latency performance in API?
116. How to configure Jenkins pipeline ?
117. What is boxing and unboxing?
118. Write java program to read every 5th line of the file and form
the string sent the result to abc@[Link]
119. Write java program to retrieve the duplicate data from DB.
120. Features added in java 11.
121. How did you create scalable microservices.
122. Why did you prefer microservices architecture.
123. Why don’t you do the same in monolithic architecture as it is
much easier , what are the benefits you saw with microservices.
124. Multithreading with example.
125. Why strings are immutable.
126. Write a code to retrieve unique record from DB
127. Write a code to retrieve record from D where id is more than
1000 and
store in List and array of employee
Table details:
emp Table id salary department

128. Write a code to find records where id is more than 1000 with
the help of java 8 stream API.

You might also like