Self introduction, technologies worked in, past project experience
what are the methods in object.
Different types of testing
How to create immutable class
What is diamond problem
Mock vs spy
Docker containers vs image
Thread locking and table booking example using thread
Use of volatile keyword in Thread safty
Relationship between equals() and hashcode()
what is wrapper class
JPA vs hibernate
swagger vs open API
Hibernate cache levels
Reflection in java
thread concurrency mechanism
• Benifit and use of unit testing
• What is diamond problem
• Mock vs stub
• How to reduce image size
• Docker containers vs image
• What is developer testing and testing isolation
• JIT and AOT
• Thread locking and table booking example using thread
• Use of volatile keyword in Thread safty
• Use of transient keyword
• Microservice communication
• Relationship between equals() and hashcode()
1. Self introduction, technologies worked in, past project experience
2. What is singleton pattern, WAP for singleton class, how to make it thread safe?
3. What are all the different design patterns implemented in your project? Explain..
4. What are SOLID principles?
5. Exception handling in java? Exception hierarchy? Exception propagation?
6. Collection framework
7. How set works internally?
8. What is difference between set and list
9. How map works internally? What is collision? How it happens
10. What is contract between hashcode and equals method
11. Java 8 features, functional interface, optional class, forEach method default and static method in interface,
stream api, lambda expressions
12. Stream api programs based on scenario?
13. What is functional programming in java, how to achieve it?
14. Spring boot, why Spring Boot over Spring MVC? Differences between Spring Boot and Spring MVC.
15. What is starting point of Spring Boot application?
16. What are all annotations combined in @SpringBootApplication
17. Spring boot annotations, @Autowired, @Service, @Componenet, @Bean, @RestController, @Qualifier,
@Configuration
18. What are all types of dependency injections and which is better?(setter based, constructor based and field
base)?
19. Steps to create spring boot project, basic structure of spring boot application.
20. What are the different ways of communicating between two services or applications?
21. Can we have two databases in one spring boot application? If yes what are the configuration we need ?
22. How Synchronous and asynchronous communication happens?
23. Have you ever worked on Kafka? What are all tools and techniques we used in kafka
24. How kafka publishes/produces events/messeage?
25. What is kafka topic? How to create partitions in kafka topic?
26. What is replica in kafka how to create and configured?
27. How subscriber listens to the published events on kafka topic?
28. How to handle global exception in spring boot?
29. What is microservice architecture?
30. What are the different design patterns of microservies architecture you worked on?
31. What is fault tolerance ?
32. What ACID properties? How to achieve thread safety in database?
33. WAQ for getting nth salary from employee table?
34. What are different joining in database?
35. Have you worked on Angular?
36. What type of work you did in angular.
37. Basic concept of angular
Kindly do let me know if you need anything else.
1.what is the difference b/w set and List?
2.How HashSet internally Works?
3.Why we need to override the Equals and Hascode while comparing the two-employee object ?
4.In Kafka how much exp you have ?
If yes-if DEV and LOCAL both are pointing the Same topic ?How it can accessible ?
5.create the Singleton call (WAP) how it can be thread safe?
8.In Java8 WAP to remove the duplicate elements. what are possible ways?
9.WAP from Employee List, it should return map in the form for key-
Key should be name values should employee object and apply the condition like
like salary should more than 5000.
Q. How to Customize u r predicate for common for other set of methods?
Q. Write a predicate and what it does internally. What has it meant?
Q. What collect method will take how it produces?
10.How Synchronous and asynchronous communication happens?
11.what are all different design pattern implemented in your projects?
12.how builder design pattern will it work?
13.Employee and Qualification -how do mapping ? Write the Query for joins both table DB Side?
14.How have you written the Junit Test case? For Given scenario how you write the code?
15.what are changes from Spring 2.0 to 3.0?if yes what you did?
16.@Autowired? what it will do how it will helpful?
17.@Qulifier ?what it will do?
18.@Configuration what is the use of it?
19.@SpringBoot Annotation consist of and how it will useful?
20.How you create the project ..Basic steps. What u follow?
21.How you communicate one service to another?
22.How you establish the produce-consumer relation? What configuration is required?
21.In your project how synchronous communications happens?
22.How to Achieve thread safety in DB, If more than one thread is updating the data?
23.How you achieved the security in your application?
24.what is security filter chain?
25what is info security ?How to Achieve?
1. How would make sure application require less maintenance?
2. How would you design a system where you have to generate reports with millions of records? What
questions you would ask to collect the requirements?
3. How asynchronous communication happens between microservices?
4. What all design patterns have you worked? Both Java and Microservices design patterns
5. What are the benefits of Kafka?
6. How does retry mechanism work with dead letter queue?
7. Advantages of interface over abstract class
8. Exceptional handling framework in general and Spring boot
9. What is memory leak? What tools have you used to detect memory leaks?
10. How would you improve the performance of the application?
11. How would you integrate sonar ?
12. Working of Junit Mockito framework?
13. What are actuators in spring boot?
14. How would you handle transaction in Spring Data Jpa?
15. What design patterns you would use in using a external library?
1.Serialization in java
2.Reverse a string/integer
3.Multithreading concepts
4.volatile and transient keyword
5.SOLID principles
6.String/StringBuilder
7.OutOfMemory Error/StackOverFlow Error
8.Sample controller class
9.Common annotations in Spring boot
10.How to validate bean
11.SQL Query to find 3rd largest salary
12.RequestParameter and PathVariable
13.Microservice architecture concepts
13.Circuit breaker/Fallback mechanism
15.HTTp status codes
1.stream api program to show the department and list of employees like this HashMap<String,
List<Employees>>
2.what are the challenges face your current project how you fixed it.
3.we have student and course table based on course you have to fetch student details
4.how to connect database using spring boot
5.if we have two databases how to connect using spring boot.
6.how to create Kafka producer and consumer
7.in single topic how many partitions we can do
8.how we can handle failure situation in Kafka.
1. What is micro-framework
2. Have you worked on neo4j
3. What is breadth first search and depth first search
4. Difference between binary tree and spanning tree
5. What we have to do to convert standalone service into cloud pods.
6. Have you created docker build file
7. What is asynchronous programming
8. What is different types in java and async libraries for asynchronous programming
9. What I have developed in Apache Kafka
10. Explain micro service architecture.
11. Explain distributed transaction management
12. What is the Raddis cache system? How to query Raddis?
1)technology stack u have worked on?
2)how u implemented kafka and rabbitMq?
3)what is mongo Db ? what are the pattern structure in MongoDb?
4)how we can do filter in mongoDB?
5)Mongo Db and Sql difference ?
6)what is graphQL?
7)how to write Junit test cases?
8)Any Columnar databases u worked on?
9)what is microservice and its architecture?
10)what is graph databases?
*Q) How do you monitor your spring boot application on prod?*
*Q) What is service discovery? Why do you need multiple Eurekas?*
*Q) What is circuit breaker DP?*
*Q) How do you handle transactions across multiple microservices?*
*Q) How do microservices communicate with each other?*
*Q) Explain the architecture of Kafka.*
*Q) How did you implement Kafka in your project?*
*Q) What is Zookeeper in Kafka? Can Kafka be used without Zookeeper?*
*Q) What do you mean by ISR in Kafka environment?*
*Q) What is consumer lag?*
*Q) What is marking the offset as soon as you read the message from Kafka broker?*
*Q) How did you implement synchronous communication between microservices?*
*Q) You have implemented some REST endpoints for CRUD functionality, how will you share your contract with
clients/other teams?*
*Q) How did you implement security end to end?*
*Q) Why Docker?*
*Q) K8 commands you used?*
*Q) How do you analyze logs of pods in your project?*
*Q) Explain the difference between a Pod and a Container in Kubernetes.*
*Q) What is the difference between CI and CD?*
*Q) Explain steps you used in CI/CD in your project.*
Why is Java a platform independent language?
Why is Java not a pure object oriented language?
What do you understand by an instance variable and a local variable?
OOPs concepts
So**l**id principles l
Design patterns
Access modifiers in java
Abstract class vs. interface
Dimond problem
How do u do Exception handling? What is throw, throws, try cath and finally blocks
Serialization De- Serialization and Externalization. How to not allow serialization of attributes of a class in
Java?
Tell us something about JIT compiler.
Can you tell the difference between equals() method and equality operator (==) in Java?
garbage collection in java- What is heap and stack memory
What is String constant pool?
Can the main method be Overloaded?
Why is the main method static in Java?
What is final keyword?
final, finally and finalize keywords use?
When can you use super keyword?
What are the differences between JVM, JRE and JDK in Java?
What are the differences between constructor and method of a class in Java?
Java works as “pass by value” or “pass by reference” phenomenon? - optional (Good to have)
—------------------------------------------------------------------------------------
1)What are the design patters used in your Microservices application
2) How to use cache in Spring Boot Application and how do you refresh the cache in spring boot application
3) What is diamond problem in java, how do you solve it
4) I have a list of string elements and some elements are duplicated.
Use java 8 how to print the highest duplicated string
5) What is default method in interface
8) What are the java8 features you used in your project
9)I have a very large file, how do u read the file fastly without getting Out Of Memory Exception and finally
stores the file data in to database
What is Serialization in java
2) How HashMap internally works in java
3) write the java program to find the consecutive repetitive character in the following string
input String : abcaaaccbb
output : a
(output is a because a is repeated 3 times consecutive in the above string)
4) What Spring Boot version you used in your project (3.4.2)
5) what is the difference between Spring and Spring Boot
6) What are the Spring Boot annotations you used in your project
7) What are the differences between @Controller, @Service, @Repository annotations
8) Spring @Component and @Qualifier related question
I have an interface A, two classes A and B are implementing interface A.
I have class Z, how to Autowire X class in class Z?
interface A{
public void run();
@Component
class X implements A{
public void run(){
System.out.println("X is running");
@Component
class Y implements A{
public void run(){
System.out.println("Y is running");
@Component
class Z{
public A a;
ans : use @Autowired and @Qualifier Annotation as follows
interface A{
public void run();
@Component("x")
class X implements A{
public void run(){
System.out.println("X is running");
@Component("y")
class Y implements A{
public void run(){
System.out.println("Y is running");
@Component
class Z{
@Autowired
@Qualifier("x")
private A a;
9) what are the scopes for a Spring bean
10) Using scopes in java inheritance concept.
what will happen if i give the scopes like this for a parent class and for a child class.
@Component
@Scope("prototype")
class A{
public void run(){
System.out.println("A is running");
@Component
@Scope("singleton")
class B extends A{
}
Oracle question
-----------------
I have product table with 3 columns having data like below,
product table:
productId productName effectiveDate
p1 x 2025-24-01
p1 y 2025-24-09
p2 z 2025-24-03
write a sql query to display all the columns (productid, productName, effectiveDate) based on maximum
effeciveDate of each product.
>Transaction Management
>Transaction Management how you handle the transaction
> What the transactional attributes?
> type of transactions?
>Api Gateway in you porject expain it
>what is jWT? when to use?
> what Collections you used in you project
>Internal of hash map
>what is Colison when to use
>When and why to use Hashcode and equals
>diff bw List and Set
> explain what sorted algorithm
>diff bw comparator and comparable
>What are the new features in java 8 and above you used
>what is the functional interface? is functional interface have only one method?
>What is autowired? how many way we can do wire
> type of autowired
>explain when to use byName and byType for autowring
>Exception Handling in SpringBoot
>how handle the request in springboot
>Expain when to use Get Post PUt DELETE method
>What is JPA
>steps: how to deploy your project and which server you using for deployment
>why to use mircorservices
>how microservices communicate ? explain each
>what is circuit breaker?
1. How dispatcher servlet will handle the request
2. What is jwt, why we need to use, how to validate the request?
Overview of jwt...?
3. List vs set vs map brief about these.
Set.add("prabkhar");
Set.add("prabkhar"); what is o/p.
4. What is Synchronization, why we need to use..? And where did you used in your project?
6. Microservice architecture, here how will you handle the request and responses
What are all the http methods? Can we use instead of get method the post method ?
What is post mapping?
Can we use select statements in post mapping?
If yes, I have an employee objects list , with post mapping, one employee object needed to create the other
employee's objects needed to update, is it possible or not ?
1) What are the design patters used in your Microservices application
2) How to use cache in Spring Boot Application and how do you refresh the cache in spring boot application
3) What is diamond problem in java, how do you solve it
4) I have a list of string elements and some elements are duplicated.
Use java 8 how to print the highest duplicated string
5) What is default method in interface
8) What are the java8 features you used in your project
9)I have a very large file, how do u read the file fastly without getting Out Of Memory Exception and finally
stores the file data in to database
1)write a code CURD operation in spring boot -written
2)tree short internal implementation and write the code -simple example
3)write code hashcode for equal and hashcode -written code with ex
4)do you know Parelle Programming(I think she is asking about thread) -
wait(),sleep(),yield() write a code and written
we have a class and have field date, salary...
we have a class and have field date, salary , dept
using java 8(strictly) write a code to fetch the data based on date, and some more condition
write the sql query find the name who is name started from A
write the sql query find the fnameLname which id is odd
why constructor present in abstract class
actuator
profile
how make Arraylist immutable
how to write immutable class and we replace variable final to any in immutable class
write program in java 8 salary and name but grouping by salary
1. Previous Project Explanation
2. Exception Handling
3. Equals Hashcode
4. Hashmap vs Concurrent hasmap
5. DI in SB
6. Spring boot custom exception
7. Annotations in SB
8. Code Spring boot application that will check if employee exists and update , if doesn't exists add new
employee (Creating DAO class, Controller, Service, Repository)
9. @Qualifier Annotation
10. @Qualifier Annotation code
11. Collection Framework
Please find today's Interview questions will discuss in the call.
first 5 digit - alphabet
second two digit number
Third special character
Fourth repated number
output: ABCDE23*232323
2. Select INFO- (name, plece, date)
Output:
25-Jan-2025
3. SELECT FORMAT(name, place, date_column,'dd-mm-yyyy') FROM table_name;
4. https://localhost:8080/citiinfo/employee/getemployee
5. Git repository to fetch the code
Push command
1) What is Serialization in java
2) How HashMap internally works in java
3) write the java program to find the consecutive repetitive character in the following string
input String : abcaaaccbb
output : a
(output is a because a is repeated 3 times consecutive in the above string)
4) What Spring Boot version you used in your project (3.4.2)
5) what is the difference between Spring and Spring Boot
6) What are the Spring Boot annotations you used in your project
7) What are the differences between @Controller, @Service, @Repository annotations
8) Spring @Component and @Qualifier related question
I have an interface A, two classes A and B are implementing interface A.
I have class Z, how to Autowire X class in class Z?
interface A{
public void run();
d
@Component
class X implements A{
public void run(){
System.out.println("X is running");
@Component
class Y implements A{
public void run(){
System.out.println("Y is running");
@Component
class Z{
public A a;
ans : use @Autowired and @Qualifier Annotation as follows
interface A{
public void run();
@Component("x")
class X implements A{
public void run(){
System.out.println("X is running");
}
}
@Component("y")
class Y implements A{
public void run(){
System.out.println("Y is running");
@Component
class Z{
@Autowired
@Qualifier("x")
private A a;
9) what are the scopes for a Spring bean
10) Using scopes in java inheritance concept.
what will happen if i give the scopes like this for a parent class and for a child class.
@Component
@Scope("prototype")
class A{
public void run(){
System.out.println("A is running");
}
@Component
@Scope("singleton")
class B extends A{
Oracle question
-----------------
I have product table with 3 columns having data like below,
product table:
productId productName effectiveDate
p1 x 2025-24-01
p1 y 2025-24-09
p2 z 2025-24-03
write a sql query to display all the columns (productid, productName, effectiveDate) based on maximum
effeciveDate of each product.
>Transaction Management
>Transaction Management how you handle the transaction
> What the transactional attributes?
> type of transactions?
>Api Gateway in you porject expain it
>what is jWT? when to use?
> what Collections you used in you project
>Internal of hash map
>what is Colison when to use
>When and why to use Hashcode and equals
>diff bw List and Set
> explain what sorted algorithm
>diff bw comparator and comparable
>What are the new features in java 8 and above you used
>what is the functional interface? is functional interface have only one method?
>What is autowired? how many way we can do wire
> type of autowired
>explain when to use byName and byType for autowring
>Exception Handling in SpringBoot
>how handle the request in springboot
>Expain when to use Get Post PUt DELETE method
>What is JPA
>steps: how to deploy your project and which server you using for deployment
>why to use mircorservices
>how microservices communicate ? explain each
>what is circuit breaker?
1. How dispatcher servlet will handle the request
2. What is jwt, why we need to use, how to validate the request?
Overview of jwt...?
3. List vs set vs map brief about these.
Set.add("prabkhar");
Set.add("prabkhar"); what is o/p.
4. What is Synchronization, why we need to use..? And where did you used in your project?
6. Microservice architecture, here how will you handle the request and responses
What are all the http methods? Can we use instead of get method the post method ?
What is post mapping?
Can we use select statements in post mapping?
If yes, I have an employee objects list , with post mapping, one employee object needed to create the other
employee's objects needed to update, is it possible or not ?
1) What are the design patters used in your Microservices application
2) How to use cache in Spring Boot Application and how do you refresh the cache in spring boot application
3) What is diamond problem in java, how do you solve it
4) I have a list of string elements and some elements are duplicated.
Use java 8 how to print the highest duplicated string
5) What is default method in interface
8) What are the java8 features you used in your project
9)I have a very large file, how do u read the file fastly without getting Out Of Memory Exception and finally
stores the file data in to database
question
1)write a code CURD operation in spring boot -written
2)tree short internal implementation and write the code -simple example
3)write code hashcode for equal and hashcode -written code with ex
4)do you know Parelle Programming(I think she is asking about thread) -
wait(),sleep(),yield() write a code and written
we have a class and have field date, salary...
we have a class and have field date, salary , dept
using java 8(strictly) write a code to fetch the data based on date, and some more condition
write the sql query find the name who is name started from A
write the sql query find the fnameLname which id is odd
why constructor present in abstract class
actuator
profile
how make Arraylist immutable
how to write immutable class and we replace variable final to any in immutable class
write program in java 8 salary and name but grouping by salary
how sql combine 2 column in single at the time of selection
1. Previous Project Explanation
2. Exception Handling
3. Equals Hashcode
4. Hashmap vs Concurrent hasmap
5. DI in SB
6. Spring boot custom exception
7. Annotations in SB
8. Code Spring boot application that will check if employee exists and update , if doesn't exists add new
employee (Creating DAO class, Controller, Service, Repository)
9. @Qualifier Annotation
10. @Qualifier Annotation code
11. Collection Framework
13. Internal working principle of Set.
1)About Project Explanation
2)Internally implementation of Linked List;
3)Difference between List and Set
4)what is Auto wired .
5)Set will allow the Duplicates objects.
6)If yes, I have an employee objects list , with post mapping, one employee object needed to create the other
employee's objects needed to update, is it possible or not ?
7)What is default method in interface.
8) Difference between Controller and Rest controller .
8) What are the java8 features you used in your project.
1. Coding Question
// Input [[101, aa, 10000],[102, ab, 10000],[103, ac, 20000],[104, ad, 20000],[105, ae, 30000],[106, af, 30000]]
// Output {30000=[[105, ae, 30000], [106, af, 30000]], 20000=[[103, ac, 20000], [104, ad, 20000]], 10000=[[101,
aa, 10000], [102, ab, 10000]]}
2. About my project
3. What microservices design pattern you used in your project
4. Which java 8 features you used in your project
1. Coding Question - sort the salary in descending order of the list
// Input [[101, aa, 10000],[102, ab, 10000],[103, ac, 20000],[104, ad, 20000],[105, ae, 30000],[106, af, 30000]]
// Output {30000=[[105, ae, 30000], [106, af, 30000]], 20000=[[103, ac, 20000], [104, ad, 20000]], 10000=[[101,
aa, 10000], [102, ab, 10000]]}
1. Program to find maximum repeated word from given statement using java 8 ?
2. Program to find duplicate numbers from integer array?
3. what is transient keyword ?
4. what is the type of synchronization ?
5. what collection is used to store the data in sorted order ?
6. How JWT works in Authentication ?
7. What is Serialization?
8. Java 8 features?
9. How to achieve Async process in java ?
10.Difference between Async and Parallel Processing?
11. Can we more than one catch block in Java?
12. can we have try block without catch ?
1.About Project in details
2.@RestController vs @Service
3. can we use @RestController instead @service? what happened code will run as normal?
4. SOLID principle
5.He ask about earlier client manager name and how you working with them.
@Controller Annotation
@Service Annotation
@Controller annotation indicates that a particular class serves the role of a controller.
@Service annotation is used with classes that provide some business functionalities.
@Controller annotation is a specialization of @Component annotation.
@Service Annotation is also a specialization of @Component Annotation.
It can be applied to classes only.
It can be applied to classes only.
It’s used to mark a class as a web request handler.
It is used to mark the class as a service provider.
It is a stereotype for the presentation layer (spring-MVC).
It is a stereotype for the service layer.
We cannot switch this annotation with any other like @Service or @Repository.
Switch can be possible
1. write a java8 code to print character occurrences in a given string
2.Write a java code to reverse a integer array without using any utility methods.
3.Write a Singleton class as a thread safe.
4. write a sql query to print
//empId,empName,managerId (Table have these 3 columns we have to print
empId,empName,managerName as output)
sample table data
Id Name ManagerId
//1 , abc ,
//2, xyz , 1
1. How to make arraylist immutable
2. How to make class as immutable
3. How 2 Threads inter communicates
4. Wait() vs sleep ()
5. What is Class not found exception
6. What is no such bean definition exception
7. Java program to group the list of employees based on salary
8. Sql query to group by students based on subject
Your personal and company data are protected in this chat
Certainly! To sort a list of custom objects in Java 8 by a double field in reverse order, you can use the
Comparator interface along with the Collections.sort method or the List.sort method. Here's an example:
Assume you have a custom class Product with a price field of type double:
public class Product {
private String name;
private double price;
// Constructor, getters, and setterspublic Product(String name, double price) {
this.name = name;
this.price = price;
public String getName() {
return name;
public double getPrice() {
return price;
}
@Overridepublic String toString() {
return "Product{name='" + name + "', price=" + price + '}';
Here are three ways to sort a list of Product objects by the price field in reverse order:
Using Collections.sort with a custom Comparator
import java.util.*;
public class Main {
public static void main(String[] args) {
List<Product> products = Arrays.asList( new Product("Product A", 10.99),
new Product("Product B", 5.49),
new Product("Product C", 20.00)
);
Collections.sort(products, Comparator.comparingDouble(Product::getPrice).reversed());
products.forEach(System.out::println);
Using List.sort with a custom Comparator
import java.util.*;
public class Main {
public static void main(String[] args) {
List<Product> products = Arrays.asList( new Product("Product A", 10.99),
new Product("Product B", 5.49),
new Product("Product C", 20.00)
);
products.sort(Comparator.comparingDouble(Product::getPrice).reversed());
products.forEach(System.out::println);
Using a lambda expression with List.sort
import java.util.*;
public class Main {
public static void main(String[] args) {
List<Product> products = Arrays.asList( new Product("Product A", 10.99),
new Product("Product B", 5.49),
new Product("Product C", 20.00)
);
products.sort((p1, p2) -> Double.compare(p2.getPrice(), p1.getPrice()));
products.forEach(System.out::println);
All three methods will sort the list of Product objects by the price field in descending order. Choose the one that
best fits your coding style!
Question: How to get output from below array using JAVA 8 or higher only
Input :-{"Pune", "Patana", "Delhi", "Chennai"}
------output------------
P -> [Pune, Patana]
D -> [Delhi]
C -> [Chennai]
Question: Why wait(),notify(),notifyAll() comes under java.lang.Object class not under Thread class?
1.Solid principle
2.Get the max occurrence of character in a string
4.Bracket {(())) question
5. @Transaction
6. Can we have two db in an application and how can we configure that
7. What kind of problems you faced in your micro services project and you resolved that
1. what is serialisation
2. How to exclude data to be serialised.
3 . What is requestMapping and requestparam annotation
4. Does abstract class have constructor
5 . Can we create object of abstract class
6 . What is executorService
7. How one thread calls other thread
8.springbootApplication annotation
9. Exclude auto configuration in spring boot
10. What is dependency injection
11. How to perform DI
1.How string will store in memory?
2.How the object will store in memory and how the segmentation will happen?
3.How to force garbage collector?
4.can we force jvm to do garbage collection?
5. Can we do intermediate operation in parallel stream?
7. Select product based on his effective date
1)why we prefer having wrapper class as key in hashmap
2) in creating immutable custom class should string fields also be deep cloned
3)how you deal with date fields in in immutable classes if you are not having deep clone objects in
constructor
1. Callable vs Runnable
2. How to convert callable into Runnable
3. difference between @component and @bean,their use cases
4. what is @Pathvariable
5. what is serialversionuuid.
6. what is serialization, how to acheive.
7. what are marker interfaces.
8. Does abstract class have constructor
9. what is the usecase of abstract class constructor.
10. Can we create object of abstract class
11. comparable vs comparator
12. Interthread communication
13. difference between abstract class and interfaces after java 8 , when each can be used.
14. what is @Transectional
EmpId, salary
1,10000
2,20000
3,20000,
4,30000,
5, 10000
Employee => id,name,salary
using streams get the Map of Employees where key is salary and value is list of emp id
o convert a Callable to a Runnable in Java, you can create a Runnable that wraps the Callable.
import java.util.concurrent.Callable;
public class CallableToRunnable {
public static void main(String[] args) {
Callable<String> callable = () -> {
// Your callable logic here
return "Callable result";
};
Runnable runnable = () -> {
try {
String result = callable.call();
System.out.println("Result: " + result);
} catch (Exception e) {
e.printStackTrace();
};
// Now you can use the runnable
new Thread(runnable).start();
}
}
In this example:
We define a Callable that returns a result.
We create a Runnable that calls the Callable’s call method and handles any exceptions.
The Runnable can then be used in a Thread or any other context where a Runnable is required.
1. Difference between monolithic and Microservice
2. Java 17 features
3. Keypoint to consider when converting Monolithic to Microservice
4. what are the advantages spring MVC vs spring boot except auto configuration
5.How cache will work spring boot Microservice environment
6. Explain Design principles
7.difference between Hibernate and JPA
8. Did you worked in Kafka?
9. How to check the performance of application?
10. How to implement the JPA query to only return specific columns?
1. principles in java? Explain each one in detail?
2.How to prevent collisions in java
3. How to write custom annotation
4. How to break Singleton pattern.
5. Find duplicates using java8?
6 . Trasient and volatail key word in java?
7 .what is the difference between Spring and Spring Boot
Lock interface
Circular Dependencies
How To prevent duplicate POST requests?
call one webservice from other service
Some Java8 programs.
Explain about previous project
2. Fail fast and Fail safe iterator
3. classNotFoundException and NoClassDefFoundException
4. wait() and sleep()
5. why optional Class is introduced
6. @Component @Bean Annotations
7. 1. Coding Question - sort the salary in descending order of the list
// Input [[101, aa, 10000],[102, ab, 10000],[103, ac, 20000],[104, ad, 20000],[105, ae, 30000],[106, af, 30000]]
// Output {30000=[[105, ae, 30000], [106, af, 30000]], 20000=[[103, ac, 20000], [104, ad, 20000]],
10000=[[101, aa, 10000], [102, ab, 10000]]}
8. I have student table like below
studentid studentfirstName studentsecondName, subject
101
102
103
104
105
write sql query to display only odd studentId's
1.write a whole crud operation (post giving emp of obj so u have to check ifdata present update db if not add to
db)
2.internal working of set
3.jwt token and how its working
4.list vs set
5.types of joins
6.what is left outer and right outer join
7.Spring boot annotations
8.what is @autowired
9.why autowired instead of new keyword
eg: @autowired
Employee e;
why not Employee e = new Employee();
10. after jwt token generatedits passedto another service right. how that service know about jwt and how we
can decode it?
1. how you create and import springboot project with java version , maven and which dependacies to add?
2. explain the working of springboot project ,how the request is gone through the application?
3. what spring feature have you used IOC or AOP ?
4. questions on design patterns
5. questions on SOLID principles
6. which java 8 features have you used?
7. SQL inner joins and outer joins
8. how you implemented hibernate in your project
9. hibernate HQL and native queries
,
hs.put(new Employee(1,"A","B"), val1);
hs.put(new Employee(1,"A","B"), val2);
How to overwrite Val1 value ?
2,
emp class
id fname LName
arrylist.add(new Employee(1,Gowtham,Nagarajan));
arrylist.add(new Employee(2,Ram,Hari));
arrylist.add(new Employee(3,Venkat,Ravi));
How to replace LastName Hari by any string, which is match with firstName is Ram in the arraylist using java
8?
3,
int[] arr = {3,5,6,9,2,4};
Find the third largest integer using java 8 ?
String strFindVal = "System";
Find the first non-repeating character ?
5, Circuit breaker concept in Microservice?
6, Where you used abstract CLASS in your project ?
7, Your microservice project performance was slow, how to improve that ?
8, Basics joins query in SQL?
9, Asking about stereotypes ?
10, what is JPA and how to achieve joins using JPA ?
1.Explain your project
2.Abstract class and Interface have you used in your project?
3.What kind of design patterns you know which designed pattern you used in your project?
4.which java 8 features have you used?
5.Question
List<Employee> elist = Arrays.asList(new Employee(1,"ABC",25000));
Map<Integer, String> mp =elist.stream().collect(Collectors.toMap(Employee::getId,Employee::getName);
6.Question
Map<Integer, String> mp = new HashMap();
Iterator<Employee> itr = elist.iterator();
while(itr.hasNext()){
Employee e = itr.next();
map.put(e.getEid(), e.getName());
7.Question
// Online Java Compiler
// Use this editor to write, compile and run your Java code online
import java.util.*;
class Main {
public static void main(String[] args) {
String s="((()())";
System.out.println(isBalanced(s));
System.out.println("Try programiz.pro");
public static boolean isBalanced(String str){
Stack<Character> st = new Stack();
for( char c : str.toCharArray() ) {
if(c == '('){
st.push(c);
else if(c == ')'){
if(st.isEmpty()){
return false;
}
char op = st.pop();
if(!IsMatching(op,c));
return false;
static boolean IsMatchig(char o, char c){
return (o == '(' && c == ')');
8.select count(*) as NoOfEmployees from employee e left join on department d where e.empid= d.empid;
9. select avg(salary) as sal from employee group by department
1)java8 program to find the highest salary of employees in each department - Map<String,Employee>
2)use of service discovery
3)Features of microservice
4)if we replace RestController to controller how application behave?
5)What will happen if return type of method in Restcontroller is void?
6)How component scan annotation works internally and why we are considering it explicitly outside sometime
7)What is the use of partioningBy method
8)There is list of employees from 3 departments(Like finance,Internal audit, Banking), write java8 program to
sort the employee object based on department(like Internal audit,Banking, Finance) and result should be
employee object
9)Questions related to kafka
10)What will happen if i override equals method only in hashmap?
1,
map.put(new Employee(1,"A","B"), "1");
map.put(new Employee(1,"A","B"), "2"); //employee hascode and equals.. if override... value1 is overriding
How to overwrite Val1 value ?
2,
emp class
id fname LName
arrylist.add(new Employee(1,Gowtham,Nagarajan));
arrylist.add(new Employee(2,Ram,Hari));
arrylist.add(new Employee(3,Venkat,Ravi));
employeeList.stream().filter(e -> "Ram".equals(e.getFirstName())).forEach(e -> e.setLastName("Java"));
How to replace LastName Hari by any string, which is match with firstName is Ram in the arraylist using java
8?
3,
int[] arr = {3,5,6,9,2,4};
Find the third largest integer using java 8 ?
Integer
thirdHighest=Arrays.stream(arr).boxed().distinct().sorted(Comparator.reverseOrder()).skip(2).findFirst().get();
Integer i = List.of(arr).stream().sorted(Comparator.reverseOrder()).skip(2).findFirst().get();
1. Difference between monolithic and Microservice
2. Java 17 features
3. Keypoint to consider when converting Monolithic to Microservice
4. what are the advantages spring MVC vs spring boot except auto configuration
5.How cache will work spring boot Microservice environment
6. Explain Design principles
7.difference between Hibernate and JPA
8. Did you worked in Kafka?
9. How to check the performance of application?
10. How to implement the JPA query to only return specific columns?
1. principles in java? Explain each one in detail? (DRY and KISS)
2.How to prevent collisions in java
3. How to write custom annotation
4. How to break Singleton pattern.
5. Find duplicates using java8?
6 . Trasient and volatail key word in java?
7 .what is the difference between Spring and Spring Boot
1. Explain about previous project
2. Fail fast and Fail safe iterator
3. classNotFoundException and NoClassDefFoundException
4. wait() and sleep()
5. why optional Class is introduced
6. @Component @Bean Annotations
arrylist.add(new Employee(3,Venkat,Ravi));
employeeList.stream().filter(e -> "Ram".equals(e.getFirstName())).forEach(e -> e.setLastName("Java"));
How to replace LastName Hari by any string, which is match with firstName is Ram in the arraylist using java
8?
3,
int[] arr = {3,5,6,9,2,4};
Find the third largest integer using java 8 ?
Integer
thirdHighest=Arrays.stream(arr).boxed().distinct().sorted(Comparator.reverseOrder()).skip(2).findFirst().get();
Integer i = List.of(arr).stream().sorted(Comparator.reverseOrder()).skip(2).findFirst().get();
4,
String strFindVal = "System";
Find the first non-repeating character ?
5, Circuit breaker concept in Microservice?
6, Where you used abstract CLASS in your project ?
7, Your microservice project performance was slow, how to improve that ?
8, Basics joins query in SQL?
inner join = equi join
left outer join = a and b equal.. left side table with no matches record (a)
right outer join = a and b equal.. right side table with no matches record (b)
full join
9, Asking about stereotypes ?
Controller, Service, Repository
10, what is JPA and how to achieve joins using JPA ?
1)java8 program to find the highest salary of employees in each department - Map<String,Employee>
2)use of service discovery
3)Features of microservice
4)if we replace RestController to controller how application behave?
@Controller method annotated with @ResponseBody. Will address the @RestController
5)What will happen if return type of method in Restcontroller is void?
6)How component scan annotation works internally and why we are considering it explicitly outside sometime
7)What is the use of partioningBy method
8)There is list of employees from 3 departments(Like finance,Internal audit, Banking), write java8 program to
sort the employee object based on department(like Internal audit,Banking, Finance) and result should be
employee object
9)Questions related to kafka
10)What will happen if i override equals method only in hashmap?
Question1 ->
Input = "Hello to my world"
Output = dlrow ym ot olleH
Question2 ->
Java
Input = "Hello"
Output = {e=1, H=1, l=2, o=1}
Question3 -> What is the use of dispatcher servlet;
Question4 -> difference between @RequestParam and @PathVariable
Question5 -> give example for the above question
Question6 -> Difference between @Component and @Bean Annotation
Question7 -> How to create a view in sql
Question8 -> How different microservices may communicate
Question9 -> Stored Procedures in mysql
Question10 -> Difference between @RestController and @Controller annotation
What is Executor and how to create Executor?
what is diff b/w submit() and execute() in executer service
what is difference between Callable and Runnable interfaces
Display list of employee who has same empId from List of employees
can you create object for Abstract class and why abstract class contains constructors?
can you create/make ArrayList as threadsafe?
what are solid principals
what is metaspace in java8 and diff b/w permgen and meta space
what are the OOPs principals
what is diff b/w wait and sleep method in thread
what is hash collision?
what is diff Optional.of and Optional.ofNullable?
Features of java 8.
Finctional Interface
Explain functional interface and when to use i.e(Consumer, producer, supplier, Function)
Calculate total salary using java 8
Find maximum salary using java 8.
Explain removeIf() method.
Load factor in hashMap.
Explain collison and resiazing in hashMap
Changes in hashMap implementation after java 8
When does hashMap convert a bucket into a tree?
Difference between Hashtable and concurrent hashmap in java.
Why is concurrenthashmap is fast?
Springboot vs Spring framework.
What is Spring profile and how to use them.
Springboot controller for handling both xml and json.
How to read properties in spring bean
Explain @Value annotation and @configuration properties
How to integrate multiple data base in springboot
Loadbalancer in springboot
Scaling microservices when number of request is increasing.
Why we use circuit breaker and How to use.
Explain design patten in microservices.
Explain api gateway in microservices.
How to communicate two webservices without using any APIs?
Diff BW JPA and Hibernate?
What is Serialization in java
How HashMap internally works in java
What Spring Boot version you used in your project (3.4.2)
what is the difference between Spring and Spring Boot
What are the Spring Boot annotations you used in your project
What are the differences between @Controller, @Service, @Repository annotations
What is Stack?
What is Queue?
Is there any APIs to improve performance of application.
If first name is same, sort the emp based on second name
1) difference between JPARepository and CRUD Repository
2) display map of students having same department
3) removing duplicates in int array without distinct in streams
4) why there is equals abstract method inside Comparator
5) Can we primitive data type for fields inside Entity classes
6) sum of elements in intArray using Streams without Streams sum method