SpringBoot_Viva_Detailed_CheatSheet
SpringBoot_Viva_Detailed_CheatSheet
Microservices
Q: What are Microservices?
A: Microservices is an architectural style that structures an application as a collection of small autonomous services,
modeled around a business domain.
Q: How do microservices communicate?
A: They usually communicate using HTTP (REST APIs) or messaging queues like RabbitMQ, Kafka.
Q: Challenges with microservices?
A: Service coordination, distributed transactions, monitoring, logging, network latency, and data consistency.
Spring Annotations
Q: @Component vs @Bean?
A: @Component is a class-level annotation used for automatic component scanning. @Bean is used at the method level
to define a bean explicitly in a configuration class.
Q: @RequestMapping vs @GetMapping?
A: @RequestMapping is a generic mapping for all HTTP methods. @GetMapping is a shortcut for
@RequestMapping(method = RequestMethod.GET).
Swagger API
Q: What is the purpose of Swagger UI?
A: It provides a visual interface for interacting with REST APIs and helps with auto-generating documentation using
annotations like @Api, @ApiOperation.
HTTP Methods
Q: When to use POST vs PUT?
A: POST is used to create new resources. PUT is used to update or replace existing resources.
Q: Is DELETE idempotent?
A: Yes, calling DELETE multiple times will result in the same outcome.