Java Spring Network
Java Spring Network
Viva Questions
1. What is Spring Boot?
Answer: Spring Boot is a framework that simplifies Java application development by
providing pre-configured settings and reducing boilerplate code.
2. What is the difference between Spring and Spring Boot?
Answer: Spring is a broad framework for Java applications, while Spring Boot provides
pre-configured templates to simplify development.
3. What is a REST API?
Answer: A REST API (Representational State Transfer) allows communication between
client and server using HTTP methods like GET, POST, PUT, DELETE.
4. What is the difference between GET and POST requests?
Answer:
5. What is Hibernate?
Answer: Hibernate is an ORM (Object-Relational Mapping) framework that simplifies
database operations by mapping Java objects to database tables.
6. What are the types of Hibernate Mappings?
Answer:
● One-to-One (@OneToOne)
● One-to-Many (@OneToMany)
● Many-to-One (@ManyToOne)
● Many-to-Many (@ManyToMany)
8. What is Maven?
Answer: Maven is a build automation tool used for managing dependencies, compiling code,
running tests, and packaging Java applications.
9. What is the default build tool used in Maven?
Answer: Maven uses Apache Ant internally but follows a more structured lifecycle.
10. What are the types of Maven repositories?
Answer:
● flatMap(): Transforms each element into a stream, then flattens all streams into a
single stream.
17. What is Collectors class in Stream API?
Answer:
Collectors is a utility class providing methods like:
● toList()
● toSet()
● joining()
● groupingBy()
● partitioningBy()
● Transaction Management.