Spring Framework

What is the Spring MVC framework used for?

What is the Spring MVC framework used for? A) To build web applications using the Model-View-Controller pattern B) To manage database connections C) To handle message queues D) To perform asynchronous processing Answer: A) To build web applications using the Model-View-Controller pattern Explanation: Spring MVC (Model-View-Controller) is a framework within the Spring Framework that is […]

What is the Spring MVC framework used for? Read More »

What is the use of the @Transactional annotation in Spring?

What is the use of the @Transactional annotation in Spring? A) To define the boundaries of a transaction B) To configure a database connection C) To schedule tasks D) To create REST endpoints Answer: A) To define the boundaries of a transaction Explanation: The @Transactional annotation in Spring is used to define the boundaries of

What is the use of the @Transactional annotation in Spring? Read More »

What is Spring AOP?

What is Spring AOP? A) A programming paradigm for modularizing cross-cutting concerns B) A tool for managing database transactions C) A library for building web applications D) A framework for dependency injection Answer: A) A programming paradigm for modularizing cross-cutting concerns Explanation: Spring AOP (Aspect-Oriented Programming) is a programming paradigm that helps modularize cross-cutting concerns,

What is Spring AOP? Read More »

What is the difference between @Component and @Bean in Spring?

What is the difference between @Component and @Bean in Spring? A) @Component is used for auto-detection, while @Bean is used for explicit bean declaration B) @Component is used for database access, while @Bean is used for services C) @Component is used in XML configuration, while @Bean is used in Java configuration D) @Component is used

What is the difference between @Component and @Bean in Spring? Read More »

Which container is responsible for managing the beans in Spring?

Which container is responsible for managing the beans in Spring? A) The Spring IoC container B) The Tomcat container C) The JPA container D) The Hibernate container Answer: A) The Spring IoC container Explanation: The Spring IoC container is responsible for managing the beans (objects) in a Spring application. It handles the creation, configuration, and

Which container is responsible for managing the beans in Spring? Read More »

What is the Spring Framework?

What is the Spring Framework? A) A comprehensive framework for Java application development B) A database management system C) A user interface library D) A logging framework Answer: A) A comprehensive framework for Java application development Explanation: The Spring Framework is a comprehensive, open-source framework for building enterprise-level Java applications. It provides a wide range

What is the Spring Framework? Read More »

What is OAuth2 in Spring Security?

What is OAuth2 in Spring Security? A) A protocol for authorization, allowing third-party applications limited access to a user’s resources B) A database management tool C) A password hashing algorithm D) A method for data encryption Answer: A) A protocol for authorization, allowing third-party applications limited access to a user’s resources Explanation: OAuth2 (Open Authorization)

What is OAuth2 in Spring Security? Read More »

Which of the following is a built-in password encoder provided by Spring Security?

Which of the following is a built-in password encoder provided by Spring Security? A) BCryptPasswordEncoder B) SHA256PasswordEncoder C) MD5PasswordEncoder D) RSAEncoder Answer: A) BCryptPasswordEncoder Explanation: Spring Security provides the BCryptPasswordEncoder as a built-in password encoder, which is widely used for securely hashing passwords. BCrypt is a strong, adaptive hashing algorithm designed to be computationally intensive,

Which of the following is a built-in password encoder provided by Spring Security? Read More »

What is the purpose of the @PreAuthorize annotation in Spring Security?

What is the purpose of the @PreAuthorize annotation in Spring Security? A) To check authorization before a method is invoked B) To encrypt user passwords C) To manage user sessions D) To log user activities Answer: A) To check authorization before a method is invoked Explanation: The @PreAuthorize annotation in Spring Security is used to

What is the purpose of the @PreAuthorize annotation in Spring Security? Read More »

What is CSRF protection in Spring Security?

What is CSRF protection in Spring Security? A) A security feature that prevents cross-site request forgery attacks B) A mechanism to secure database transactions C) A tool to encrypt user passwords D) A method to manage user sessions Answer: A) A security feature that prevents cross-site request forgery attacks Explanation: CSRF (Cross-Site Request Forgery) protection

What is CSRF protection in Spring Security? Read More »

Which annotation is used to secure a method in Spring Security?

Which annotation is used to secure a method in Spring Security? A) @Secured B) @Authenticated C) @Protected D) @Restricted Answer: A) @Secured Explanation: The @Secured annotation in Spring Security is used to secure individual methods by specifying which roles are allowed to invoke them. This annotation can be applied to methods in your service or

Which annotation is used to secure a method in Spring Security? Read More »

What is the purpose of the @EnableWebSecurity annotation?

What is the purpose of the @EnableWebSecurity annotation? A) To enable Spring Security’s web security support B) To configure database access C) To enable Spring Boot’s auto-configuration D) To create REST APIs Answer: A) To enable Spring Security’s web security support Explanation: The @EnableWebSecurity annotation is used to enable Spring Security’s web security support in

What is the purpose of the @EnableWebSecurity annotation? Read More »

What is the default username when using Spring Security out-of-the-box?

What is the default username when using Spring Security out-of-the-box? A) user B) admin C) root D) spring Answer: A) user Explanation: When you add Spring Security to a Spring Boot project without any custom configuration, Spring Security provides a default username, which is “user”. The default password is generated and displayed in the console

What is the default username when using Spring Security out-of-the-box? Read More »

What is Spring Security used for in a Spring application?

What is Spring Security used for in a Spring application? A) To provide authentication and authorization features B) To handle database connections C) To manage application logs D) To build user interfaces Answer: A) To provide authentication and authorization features Explanation: Spring Security is a powerful and customizable authentication and access control framework for Spring

What is Spring Security used for in a Spring application? Read More »

How does Spring Boot help in building microservices?

How does Spring Boot help in building microservices? A) By providing a framework that simplifies the development of production-ready applications B) By enforcing the use of a monolithic architecture C) By centralizing database access for all services D) By providing a UI framework for building web applications Answer: A) By providing a framework that simplifies

How does Spring Boot help in building microservices? Read More »

What is the purpose of an event-driven architecture in microservices?

What is the purpose of an event-driven architecture in microservices? A) To enable services to communicate asynchronously using events B) To ensure synchronous communication between services C) To manage service configurations D) To log events generated by microservices Answer: A) To enable services to communicate asynchronously using events Explanation: An event-driven architecture in microservices allows

What is the purpose of an event-driven architecture in microservices? Read More »

What is the role of service orchestration in microservices?

What is the role of service orchestration in microservices? A) To coordinate multiple microservices to work together and accomplish a task B) To store logs generated by microservices C) To deploy microservices to the cloud D) To manage databases for microservices Answer: A) To coordinate multiple microservices to work together and accomplish a task Explanation:

What is the role of service orchestration in microservices? Read More »

Why is decentralization important in microservices architecture?

Why is decentralization important in microservices architecture? A) It allows teams to develop, deploy, and scale services independently B) It centralizes all service configurations C) It mandates a single technology stack for all services D) It requires all services to use the same database Answer: A) It allows teams to develop, deploy, and scale services

Why is decentralization important in microservices architecture? Read More »

Scroll to Top