Spring Boot Objective Questions and Answers - Set 2

Test your Spring Boot skills with carefully curated MCQs designed for real-world development and interview preparation. Focused on configuration, REST APIs, data access, security, and production-ready applications. This is part 2 of the series.

Practice Spring Boot MCQs with Detailed Explanations

Answer at least 12 questions to submit and verify answers.

16 Which annotation is used to mark a class as a JPA entity? Easy

17 What is Spring Boot Actuator mainly used for? Medium

18 Which profile is activated by default? Easy

19 What is the use of @Primary annotation? Medium

20 Which cache abstraction is supported by Spring Boot? Medium

21 What does @Transactional ensure? Medium

22 Which annotation maps HTTP GET requests? Easy

23 Which layer should contain business logic in a typical Spring Boot application? Medium

24 What is the default JSON library used by Spring Boot? Medium

25 Which annotation is used for asynchronous method execution? Medium

26 Which testing annotation loads only the web layer? Hard

27 What is the purpose of CommandLineRunner? Medium

28 Which dependency enables JPA support? Easy

29 What is the default fetch type for @ManyToOne? Hard

30 Which annotation marks a method as read-only transaction? Hard