{"id":22567768,"url":"https://github.com/bikkimahato/spring-interview-questions","last_synced_at":"2025-07-20T07:05:48.097Z","repository":{"id":264775924,"uuid":"894085610","full_name":"bikkimahato/spring-interview-questions","owner":"bikkimahato","description":"Welcome to the Spring Interview Questions repository! This repository is your go-to resource for preparing for Spring Framework interviews. It includes a comprehensive collection of questions and answers covering a wide range of topics and difficulty levels.","archived":false,"fork":false,"pushed_at":"2025-01-25T18:23:35.000Z","size":188,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T01:52:04.100Z","etag":null,"topics":["spring","spring-core"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bikkimahato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-25T18:16:08.000Z","updated_at":"2025-03-01T13:05:14.000Z","dependencies_parsed_at":"2024-11-26T09:32:29.523Z","dependency_job_id":"10295217-4964-448c-a604-f687d7411d8c","html_url":"https://github.com/bikkimahato/spring-interview-questions","commit_stats":null,"previous_names":["bikkimahato/spring-interview-questions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikkimahato%2Fspring-interview-questions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikkimahato%2Fspring-interview-questions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikkimahato%2Fspring-interview-questions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikkimahato%2Fspring-interview-questions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bikkimahato","download_url":"https://codeload.github.com/bikkimahato/spring-interview-questions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991540,"owners_count":21194894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["spring","spring-core"],"created_at":"2024-12-08T00:09:05.760Z","updated_at":"2025-04-15T01:52:10.271Z","avatar_url":"https://github.com/bikkimahato.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Interview Questions\n\n![Spring Logo](https://spring.io/img/spring-2.svg)\n\nWelcome to the Spring Interview Questions repository! This repository is your go-to resource for preparing for Spring Framework interviews. It includes a comprehensive collection of questions and answers covering a wide range of topics and difficulty levels.\n\n## Introduction\n\nThis repository aims to help you prepare for Spring Framework interviews by providing a curated list of commonly asked questions along with detailed answers. Whether you're a beginner or an experienced developer, this resource will help you enhance your Spring knowledge and be well-prepared for your next interview.\n\n## Topics Covered\n\n- [Spring Core](#spring-core)\n- [Spring MVC](#spring-mvc)\n- [Spring Data JPA](#spring-data-jpa)\n- [Spring Security](#spring-security)\n- [Spring AOP](#spring-aop)\n- [Spring Cloud](#spring-cloud)\n- [Spring Batch](#spring-batch)\n- [Spring Integration](#spring-integration)\n\n## How to Use\n\nTo use this repository, browse through the topics and questions. You can also clone the repository to your local machine for offline access.\n\n```sh\ngit clone https://github.com/bikkimahato/spring-interview-questions.git\n```\n\n## Contributing\n\nContributions are welcome! If you have additional questions, answers, or improvements, please fork the repository and create a pull request. For major changes, please open an issue first to discuss what you would like to change.\n\n---\n\nHappy Interview Preparation!\n\nHappy coding! If you find this repository helpful, please give it a star ⭐ and share it with others.\n\n---\n\n## Spring Core\n### Table of Contents\n### Level : Spring Core Easy\n| No. | Questions |\n| --- | --------- |\n| 1   | [What is the Spring Framework?](#1-what-is-the-spring-framework) |\n| 2   | [What are the advantages of using Spring Framework?](#2-what-are-the-advantages-of-using-spring-framework) |\n| 3   | [Explain Dependency Injection.](#3-explain-dependency-injection) |\n| 4   | [What are the different types of Dependency Injection?](#4-what-are-the-different-types-of-dependency-injection) |\n| 5   | [What is the BeanFactory in Spring?](#5-what-is-the-beanfactory-in-spring) |\n| 6   | [What is the ApplicationContext in Spring?](#6-what-is-the-applicationcontext-in-spring) |\n| 7   | [What is the difference between BeanFactory and ApplicationContext?](#7-what-is-the-difference-between-beanfactory-and-applicationcontext) |\n| 8   | [How do you configure a Spring application using XML?](#8-how-do-you-configure-a-spring-application-using-xml) |\n| 9   | [What is a Spring Bean?](#9-what-is-a-spring-bean) |\n| 10  | [What are the different scopes of Spring Beans?](#10-what-are-the-different-scopes-of-spring-beans) |\n| 11  | [How do you define a Spring Bean in XML configuration?](#11-how-do-you-define-a-spring-bean-in-xml-configuration) |\n| 12  | [What is the default scope of a Spring Bean?](#12-what-is-the-default-scope-of-a-spring-bean) |\n| 13  | [How do you inject a bean using constructor injection?](#13-how-do-you-inject-a-bean-using-constructor-injection) |\n| 14  | [How do you inject a bean using setter injection?](#14-how-do-you-inject-a-bean-using-setter-injection) |\n| 15  | [What is the role of the @Autowired annotation?](#15-what-is-the-role-of-the-autowired-annotation) |\n| 16  | [What is the purpose of the @Component annotation?](#16-what-is-the-purpose-of-the-component-annotation) |\n| 17  | [What are Spring stereotypes?](#17-what-are-spring-stereotypes) |\n| 18  | [How do you enable component scanning in Spring?](#18-how-do-you-enable-component-scanning-in-spring) |\n| 19  | [What is the difference between @Component, @Service, @Repository, and @Controller?](#19-what-is-the-difference-between-component-service-repository-and-controller) |\n| 20  | [How do you handle bean autowiring in Spring?](#20-how-do-you-handle-bean-autowiring-in-spring) |\n| 21  | [What is the use of the @Qualifier annotation?](#21-what-is-the-use-of-the-qualifier-annotation) |\n| 22  | [What is the Spring IoC container?](#22-what-is-the-spring-ioc-container) |\n| 23  | [Explain the lifecycle of a Spring Bean.](#23-explain-the-lifecycle-of-a-spring-bean) |\n| 24  | [What is Spring AOP framework?](#24-what-is-spring-aop-framework) |\n| 25  | [What is a pointcut in Spring AOP?](#25-what-is-a-pointcut-in-spring-aop) |\n| 26  | [What is an advice in Spring AOP?](#26-what-is-an-advice-in-spring-aop) |\n| 27  | [What are the different types of advice in Spring AOP?](#27-what-are-the-different-types-of-advice-in-spring-aop) |\n| 28  | [What is a join point in Spring AOP?](#28-what-is-a-join-point-in-spring-aop) |\n| 29  | [What is a proxy in Spring AOP?](#29-what-is-a-proxy-in-spring-aop) |\n| 30  | [How do you configure AOP in Spring using XML?](#30-how-do-you-configure-aop-in-spring-using-xml) |\n| 31  | [Explain the concept of Aspect in Spring AOP.](#31-explain-the-concept-of-aspect-in-spring-aop) |\n| 32  | [What is the @Aspect annotation used for?](#32-what-is-the-aspect-annotation-used-for) |\n| 33  | [How do you configure transactions in Spring?](#33-how-do-you-configure-transactions-in-spring) |\n| 34  | [What is the @Transactional annotation?](#34-what-is-the-transactional-annotation) |\n| 35  | [What is the difference between programmatic and declarative transaction management?](#35-what-is-the-difference-between-programmatic-and-declarative-transaction-management) |\n| 36  | [How do you manage properties in Spring?](#36-how-do-you-manage-properties-in-spring) |\n| 37  | [What is the Environment abstraction in Spring?](#37-what-is-the-environment-abstraction-in-spring) |\n| 38  | [How do you use @PropertySource to load properties in Spring?](#38-how-do-you-use-propertysource-to-load-properties-in-spring) |\n| 39  | [What is Spring Expression Language (SpEL)?](#39-what-is-spring-expression-language-spel) |\n| 40  | [How do you use SpEL in Spring applications?](#40-how-do-you-use-spel-in-spring-applications) |\n| 41  | [What is the purpose of the @Value annotation?](#41-what-is-the-purpose-of-the-value-annotation) |\n| 42  | [What is the Spring JDBC template?](#42-what-is-the-spring-jdbc-template) |\n| 43  | [How do you configure a DataSource in Spring?](#43-how-do-you-configure-a-datasource-in-spring) |\n| 44  | [How do you use the JdbcTemplate in Spring?](#44-how-do-you-use-the-jdbctemplate-in-spring) |\n| 45  | [What is the purpose of the @Repository annotation?](#45-what-is-the-purpose-of-the-repository-annotation) |\n| 46  | [What is the Spring Data JPA?](#46-what-is-the-spring-data-jpa) |\n| 47  | [How do you define a repository in Spring Data JPA?](#47-how-do-you-define-a-repository-in-spring-data-jpa) |\n| 48  | [What is the purpose of the @Entity annotation?](#48-what-is-the-purpose-of-the-entity-annotation) |\n| 49  | [What is the use of the @Id annotation in Spring Data JPA?](#49-what-is-the-use-of-the-id-annotation-in-spring-data-jpa) |\n| 50  | [How do you define a primary key generation strategy in Spring Data JPA?](#50-how-do-you-define-a-primary-key-generation-strategy-in-spring-data-jpa) |\n\n### Level : Spring Core Medium\n| No. | Questions |\n| --- | --------- |\n| 51  | [How does Spring manage transactions?](#51-how-does-spring-manage-transactions) |\n| 52  | [Explain the concept of Bean Post Processors.](#52-explain-the-concept-of-bean-post-processors) |\n| 53  | [How do you create a custom Bean Post Processor?](#53-how-do-you-create-a-custom-bean-post-processor) |\n| 54  | [What is the BeanFactoryPostProcessor and how is it different from BeanPostProcessor?](#54-what-is-the-beanfactorypostprocessor-and-how-is-it-different-from-beanpostprocessor) |\n| 55  | [How does Spring handle circular dependencies?](#55-how-does-spring-handle-circular-dependencies) |\n| 56  | [What is the use of the @Scope annotation?](#56-what-is-the-use-of-the-scope-annotation) |\n| 57  | [Explain the concept of Spring Profiles.](#57-explain-the-concept-of-spring-profiles) |\n| 58  | [How do you manage environment-specific properties in Spring?](#58-how-do-you-manage-environment-specific-properties-in-spring) |\n| 59  | [What is the role of the @Profile annotation?](#59-what-is-the-role-of-the-profile-annotation) |\n| 60  | [How do you enable asynchronous method execution in Spring?](#60-how-do-you-enable-asynchronous-method-execution-in-spring) |\n| 61  | [What is the use of the @Async annotation?](#61-what-is-the-use-of-the-async-annotation) |\n| 62  | [How do you implement caching in Spring?](#62-how-do-you-implement-caching-in-spring) |\n| 63  | [What is the use of the @Cacheable annotation?](#63-what-is-the-use-of-the-cacheable-annotation) |\n| 64  | [How do you configure a cache manager in Spring?](#64-how-do-you-configure-a-cache-manager-in-spring) |\n| 65  | [What is the Spring Event model?](#65-what-is-the-spring-event-model) |\n| 66  | [How do you publish and listen to events in Spring?](#66-how-do-you-publish-and-listen-to-events-in-spring) |\n| 67  | [What is the use of the @EventListener annotation?](#67-what-is-the-use-of-the-eventlistener-annotation) |\n| 68  | [What is Spring's Task Scheduler?](#68-what-is-springs-task-scheduler) |\n| 69  | [How do you schedule tasks in Spring?](#69-how-do-you-schedule-tasks-in-spring) |\n| 70  | [What is the use of the @Scheduled annotation?](#70-what-is-the-use-of-the-scheduled-annotation) |\n| 71  | [What is the Spring Web MVC framework?](#71-what-is-the-spring-web-mvc-framework) |\n| 72  | [How do you configure a DispatcherServlet in Spring?](#72-how-do-you-configure-a-dispatcherservlet-in-spring) |\n| 73  | [What is the role of the @Controller annotation?](#73-what-is-the-role-of-the-controller-annotation) |\n| 74  | [How do you handle form submissions in Spring MVC?](#74-how-do-you-handle-form-submissions-in-spring-mvc) |\n| 75  | [What is the use of the @RequestMapping annotation?](#75-what-is-the-use-of-the-requestmapping-annotation) |\n| 76  | [How do you handle exceptions in Spring MVC?](#76-how-do-you-handle-exceptions-in-spring-mvc) |\n| 77  | [What is the use of the @ExceptionHandler annotation?](#77-what-is-the-use-of-the-exceptionhandler-annotation) |\n| 78  | [How do you configure view resolvers in Spring MVC?](#78-how-do-you-configure-view-resolvers-in-spring-mvc) |\n| 79  | [What is the use of the @ModelAttribute annotation?](#79-what-is-the-use-of-the-modelattribute-annotation) |\n| 80  | [How do you perform validation in Spring MVC?](#80-how-do-you-perform-validation-in-spring-mvc) |\n| 81  | [What is the use of the @Valid annotation?](#81-what-is-the-use-of-the-valid-annotation) |\n| 82  | [How do you handle file uploads in Spring MVC?](#82-how-do-you-handle-file-uploads-in-spring-mvc) |\n| 83  | [What is the use of the MultipartResolver in Spring MVC?](#83-what-is-the-use-of-the-multipartresolver-in-spring-mvc) |\n| 84  | [Explain the concept of RestTemplate in Spring.](#84-explain-the-concept-of-resttemplate-in-spring) |\n| 85  | [How do you configure RestTemplate in Spring?](#85-how-do-you-configure-resttemplate-in-spring) |\n| 86  | [How do you make HTTP requests using RestTemplate?](#86-how-do-you-make-http-requests-using-resttemplate) |\n| 87  | [What is the Spring WebFlux framework?](#87-what-is-the-spring-webflux-framework) |\n| 88  | [How do you configure a WebFlux application in Spring?](#88-how-do-you-configure-a-webflux-application-in-spring) |\n| 89  | [What is the role of the @RestController annotation?](#89-what-is-the-role-of-the-restcontroller-annotation) |\n| 90  | [How do you handle reactive streams in Spring WebFlux?](#90-how-do-you-handle-reactive-streams-in-spring-webflux) |\n| 91  | [What is the Spring Boot framework?](#91-what-is-the-spring-boot-framework) |\n| 92  | [How do you configure a Spring Boot application?](#92-how-do-you-configure-a-spring-boot-application) |\n| 93  | [What are the benefits of using Spring Boot?](#93-what-are-the-benefits-of-using-spring-boot) |\n| 94  | [How do you create a RESTful web service using Spring Boot?](#94-how-do-you-create-a-restful-web-service-using-spring-boot) |\n| 95  | [What is the role of the application.properties file in Spring Boot?](#95-what-is-the-role-of-the-application-properties-file-in-spring-boot) |\n| 96  | [How do you configure logging in Spring Boot?](#96-how-do-you-configure-logging-in-spring-boot) |\n| 97  | [How do you handle exceptions in a Spring Boot application?](#97-how-do-you-handle-exceptions-in-a-spring-boot-application) |\n| 98  | [What is the use of the @SpringBootApplication annotation?](#98-what-is-the-use-of-the-springbootapplication-annotation) |\n| 99  | [How do you run a Spring Boot application?](#99-how-do-you-run-a-spring-boot-application) |\n| 100 | [How do you test a Spring Boot application?](#100-how-do-you-test-a-spring-boot-application) |\n\n### Level : Spring Core Hard\n| No. | Questions |\n| --- | --------- |\n| 101 | [Explain the concept of Reactive Programming in Spring.](#101-explain-the-concept-of-reactive-programming-in-spring) |\n| 102 | [How does Spring WebFlux handle backpressure?](#102-how-does-spring-webflux-handle-backpressure) |\n| 103 | [What is the difference between Spring MVC and Spring WebFlux?](#103-what-is-the-difference-between-spring-mvc-and-spring-webflux) |\n| 104 | [How do you configure security in a Spring application?](#104-how-do-you-configure-security-in-a-spring-application) |\n| 105 | [What is the role of the @EnableWebSecurity annotation?](#105-what-is-the-role-of-the-enablewebsecurity-annotation) |\n| 106 | [How do you implement OAuth2 authentication in Spring Security?](#106-how-do-you-implement-oauth2-authentication-in-spring-security) |\n| 107 | [What is the use of the @PreAuthorize annotation?](#107-what-is-the-use-of-the-preauthorize-annotation) |\n| 108 | [How do you implement method-level security in Spring?](#108-how-do-you-implement-method-level-security-in-spring) |\n| 109 | [How do you configure a custom authentication provider in Spring Security?](#109-how-do-you-configure-a-custom-authentication-provider-in-spring-security) |\n| 110 | [What is the purpose of the SecurityContextHolder in Spring Security?](#110-what-is-the-purpose-of-the-securitycontextholder-in-spring-security) |\n| 111 | [Explain the concept of CSRF protection in Spring Security.](#111-explain-the-concept-of-csrf-protection-in-spring-security) |\n| 112 | [How do you configure session management in Spring Security?](#112-how-do-you-configure-session-management-in-spring-security) |\n| 113 | [What is the use of the @EnableAspectJAutoProxy annotation?](#113-what-is-the-use-of-the-enableaspectjautoproxy-annotation) |\n| 114 | [How do you implement global exception handling in Spring?](#114-how-do-you-implement-global-exception-handling-in-spring) |\n| 115 | [What is the use of the @ControllerAdvice annotation?](#115-what-is-the-use-of-the-controlleradvice-annotation) |\n| 116 | [How do you configure internationalization in a Spring application?](#116-how-do-you-configure-internationalization-in-a-spring-application) |\n| 117 | [What is the use of the MessageSource interface in Spring?](#117-what-is-the-use-of-the-messagesource-interface-in-spring) |\n| 118 | [How do you create a custom validator in Spring?](#118-how-do-you-create-a-custom-validator-in-spring) |\n| 119 | [What is the use of the @InitBinder annotation?](#119-what-is-the-use-of-the-initbinder-annotation) |\n| 120 | [How do you configure a custom property editor in Spring?](#120-how-do-you-configure-a-custom-property-editor-in-spring) |\n| 121 | [Explain the concept of Spring Cloud.](#121-explain-the-concept-of-spring-cloud) |\n| 122 | [How do you configure a microservice using Spring Cloud?](#122-how-do-you-configure-a-microservice-using-spring-cloud) |\n| 123 | [What is the use of the @EnableEurekaClient annotation?](#123-what-is-the-use-of-the-enableeurekaclient-annotation) |\n| 124 | [How do you configure load balancing in Spring Cloud?](#124-how-do-you-configure-load-balancing-in-spring-cloud) |\n| 125 | [What is the use of the @EnableFeignClients annotation?](#125-what-is-the-use-of-the-enablefeignclients-annotation) |\n| 126 | [How do you implement circuit breaker pattern in Spring Cloud?](#126-how-do-you-implement-circuit-breaker-pattern-in-spring-cloud) |\n| 127 | [What is the use of the @EnableCircuitBreaker annotation?](#127-what-is-the-use-of-the-enablecircuitbreaker-annotation) |\n| 128 | [How do you configure a distributed tracing system in Spring Cloud?](#128-how-do-you-configure-a-distributed-tracing-system-in-spring-cloud) |\n| 129 | [What is the use of the @EnableHystrixDashboard annotation?](#129-what-is-the-use-of-the-enablehystrixdashboard-annotation) |\n| 130 | [How do you configure a service gateway in Spring Cloud?](#130-how-do-you-configure-a-service-gateway-in-spring-cloud) |\n| 131 | [What is the use of the @EnableZuulProxy annotation?](#131-what-is-the-use-of-the-enablezuulproxy-annotation) |\n| 132 | [How do you implement API versioning in a Spring application?](#132-how-do-you-implement-api-versioning-in-a-spring-application) |\n| 133 | [What is the use of the @JsonView annotation in Spring?](#133-what-is-the-use-of-the-jsonview-annotation-in-spring) |\n| 134 | [How do you configure a custom JSON serializer in Spring?](#134-how-do-you-configure-a-custom-json-serializer-in-spring) |\n| 135 | [What is the use of the @JsonIgnore annotation?](#135-what-is-the-use-of-the-jsonignore-annotation) |\n| 136 | [How do you configure a custom exception handler in Spring?](#136-how-do-you-configure-a-custom-exception-handler-in-spring) |\n| 137 | [What is the use of the @RestControllerAdvice annotation?](#137-what-is-the-use-of-the-restcontrolleradvice-annotation) |\n| 138 | [How do you configure CORS in a Spring application?](#138-how-do-you-configure-cors-in-a-spring-application) |\n| 139 | [What is the use of the @CrossOrigin annotation?](#139-what-is-the-use-of-the-crossorigin-annotation) |\n| 140 | [How do you configure a custom HTTP message converter in Spring?](#140-how-do-you-configure-a-custom-http-message-converter-in-spring) |\n| 141 | [What is the use of the HttpMessageConverter interface in Spring?](#141-what-is-the-use-of-the-httpmessageconverter-interface-in-spring) |\n| 142 | [How do you configure a custom view resolver in Spring?](#142-how-do-you-configure-a-custom-view-resolver-in-spring) |\n| 143 | [What is the use of the ViewResolver interface in Spring?](#143-what-is-the-use-of-the-viewresolver-interface-in-spring) |\n| 144 | [How do you configure a custom locale resolver in Spring?](#144-how-do-you-configure-a-custom-locale-resolver-in-spring) |\n| 145 | [What is the use of the LocaleResolver interface in Spring?](#145-what-is-the-use-of-the-localeresolver-interface-in-spring) |\n| 146 | [How do you configure a custom theme resolver in Spring?](#146-how-do-you-configure-a-custom-theme-resolver-in-spring) |\n| 147 | [What is the use of the ThemeResolver interface in Spring?](#147-what-is-the-use-of-the-themeresolver-interface-in-spring) |\n| 148 | [How do you configure a custom session attribute in Spring?](#148-how-do-you-configure-a-custom-session-attribute-in-spring) |\n| 149 | [What is the use of the SessionAttributeStore interface in Spring?](#149-what-is-the-use-of-the-sessionattributestore-interface-in-spring) |\n| 150 | [How do you configure a custom handler interceptor in Spring?](#150-how-do-you-configure-a-custom-handler-interceptor-in-spring) |\n\n## Spring MVC\n### Table of Contents\n### Level : Spring MVC Easy\n| No. | Questions |\n| --- | --------- |\n| 1   | [What is Spring MVC?](#1-what-is-spring-mvc) |\n| 2   | [Explain the architecture of Spring MVC.](#2-explain-the-architecture-of-spring-mvc) |\n| 3   | [What are the main components of Spring MVC?](#3-what-are-the-main-components-of-spring-mvc) |\n| 4   | [How do you configure Spring MVC in a web application?](#4-how-do-you-configure-spring-mvc-in-a-web-application) |\n| 5   | [What is the role of DispatcherServlet in Spring MVC?](#5-what-is-the-role-of-dispatcherservlet-in-spring-mvc) |\n| 6   | [How do you define a controller in Spring MVC?](#6-how-do-you-define-a-controller-in-spring-mvc) |\n| 7   | [What is the use of @RequestMapping annotation?](#7-what-is-the-use-of-requestmapping-annotation) |\n| 8   | [How do you handle form submission in Spring MVC?](#8-how-do-you-handle-form-submission-in-spring-mvc) |\n| 9   | [What is ModelAndView in Spring MVC?](#9-what-is-modelandview-in-spring-mvc) |\n| 10  | [How do you return JSON data from a Spring MVC controller?](#10-how-do-you-return-json-data-from-a-spring-mvc-controller) |\n| 11  | [Explain the difference between @Controller and @RestController.](#11-explain-the-difference-between-controller-and-restcontroller) |\n| 12  | [What is the use of @PathVariable annotation?](#12-what-is-the-use-of-pathvariable-annotation) |\n| 13  | [How do you inject a service into a Spring MVC controller?](#13-how-do-you-inject-a-service-into-a-spring-mvc-controller) |\n| 14  | [What is the role of ViewResolver in Spring MVC?](#14-what-is-the-role-of-viewresolver-in-spring-mvc) |\n| 15  | [How do you handle exceptions in Spring MVC?](#15-how-do-you-handle-exceptions-in-spring-mvc) |\n| 16  | [What is the difference between @RequestParam and @PathVariable?](#16-what-is-the-difference-between-requestparam-and-pathvariable) |\n| 17  | [How do you perform validation in Spring MVC?](#17-how-do-you-perform-validation-in-spring-mvc) |\n| 18  | [What is the use of @ModelAttribute annotation?](#18-what-is-the-use-of-modelattribute-annotation) |\n| 19  | [How do you configure a view resolver in Spring MVC?](#19-how-do-you-configure-a-view-resolver-in-spring-mvc) |\n| 20  | [What is the default scope of a Spring MVC controller?](#20-what-is-the-default-scope-of-a-spring-mvc-controller) |\n| 21  | [How do you handle file uploads in Spring MVC?](#21-how-do-you-handle-file-uploads-in-spring-mvc) |\n| 22  | [What is the difference between @RequestBody and @ResponseBody?](#22-what-is-the-difference-between-requestbody-and-responsebody) |\n| 23  | [How do you configure a multipart resolver in Spring MVC?](#23-how-do-you-configure-a-multipart-resolver-in-spring-mvc) |\n| 24  | [How do you enable Spring MVC annotations?](#24-how-do-you-enable-spring-mvc-annotations) |\n| 25  | [What is the use of @SessionAttributes annotation?](#25-what-is-the-use-of-sessionattributes-annotation) |\n\n### Level : Spring MVC Medium\n| No. | Questions |\n| --- | --------- |\n| 26  | [How do you manage static resources in Spring MVC?](#26-how-do-you-manage-static-resources-in-spring-mvc) |\n| 27  | [Explain the role of HandlerMapping in Spring MVC.](#27-explain-the-role-of-handlermapping-in-spring-mvc) |\n| 28  | [What is the use of @InitBinder annotation?](#28-what-is-the-use-of-initbinder-annotation) |\n| 29  | [How do you handle cross-origin requests in Spring MVC?](#29-how-do-you-handle-cross-origin-requests-in-spring-mvc) |\n| 30  | [How do you configure internationalization in Spring MVC?](#30-how-do-you-configure-internationalization-in-spring-mvc) |\n| 31  | [What is the role of Interceptor in Spring MVC?](#31-what-is-the-role-of-interceptor-in-spring-mvc) |\n| 32  | [How do you implement security in a Spring MVC application?](#32-how-do-you-implement-security-in-a-spring-mvc-application) |\n| 33  | [What is the difference between Spring MVC and Spring Boot?](#33-what-is-the-difference-between-spring-mvc-and-spring-boot) |\n| 34  | [How do you configure a custom HandlerExceptionResolver in Spring MVC?](#34-how-do-you-configure-a-custom-handlerexceptionresolver-in-spring-mvc) |\n| 35  | [What is the use of @CookieValue annotation?](#35-what-is-the-use-of-cookievalue-annotation) |\n| 36  | [How do you configure message converters in Spring MVC?](#36-how-do-you-configure-message-converters-in-spring-mvc) |\n| 37  | [What is the role of LocaleResolver in Spring MVC?](#37-what-is-the-role-of-localeresolver-in-spring-mvc) |\n| 38  | [How do you enable CORS in Spring MVC?](#38-how-do-you-enable-cors-in-spring-mvc) |\n| 39  | [What is the use of @RequestHeader annotation?](#39-what-is-the-use-of-requestheader-annotation) |\n| 40  | [How do you implement RESTful web services using Spring MVC?](#40-how-do-you-implement-restful-web-services-using-spring-mvc) |\n| 41  | [How do you integrate Spring MVC with Thymeleaf?](#41-how-do-you-integrate-spring-mvc-with-thymeleaf) |\n| 42  | [What is the use of @ResponseStatus annotation?](#42-what-is-the-use-of-responsestatus-annotation) |\n| 43  | [How do you configure a custom view resolver in Spring MVC?](#43-how-do-you-configure-a-custom-view-resolver-in-spring-mvc) |\n| 44  | [What is the role of MultipartResolver in Spring MVC?](#44-what-is-the-role-of-multipartresolver-in-spring-mvc) |\n| 45  | [How do you handle AJAX requests in Spring MVC?](#45-how-do-you-handle-ajax-requests-in-spring-mvc) |\n| 46  | [What is the difference between @RequestMapping and @GetMapping?](#46-what-is-the-difference-between-requestmapping-and-getmapping) |\n| 47  | [How do you configure a custom interceptor in Spring MVC?](#47-how-do-you-configure-a-custom-interceptor-in-spring-mvc) |\n| 48  | [What is the use of @MatrixVariable annotation?](#48-what-is-the-use-of-matrixvariable-annotation) |\n| 49  | [How do you configure a custom validator in Spring MVC?](#49-how-do-you-configure-a-custom-validator-in-spring-mvc) |\n| 50  | [What is the role of FlashMap in Spring MVC?](#50-what-is-the-role-of-flashmap-in-spring-mvc) |\n\n### Level : Spring MVC Hard\n| No. | Questions |\n| --- | --------- |\n| 51  | [How do you implement asynchronous request processing in Spring MVC?](#51-how-do-you-implement-asynchronous-request-processing-in-spring-mvc) |\n| 52  | [Explain the process of configuring Spring MVC with Java-based configuration.](#52-explain-the-process-of-configuring-spring-mvc-with-java-based-configuration) |\n| 53  | [How do you configure a custom message converter in Spring MVC?](#53-how-do-you-configure-a-custom-message-converter-in-spring-mvc) |\n| 54  | [What is the use of @ControllerAdvice annotation?](#54-what-is-the-use-of-controlleradvice-annotation) |\n| 55  | [How do you handle WebSocket communication in a Spring MVC application?](#55-how-do-you-handle-websocket-communication-in-a-spring-mvc-application) |\n| 56  | [How do you configure a custom locale resolver in Spring MVC?](#56-how-do-you-configure-a-custom-locale-resolver-in-spring-mvc) |\n| 57  | [Explain the role of WebApplicationInitializer in Spring MVC.](#57-explain-the-role-of-webapplicationinitializer-in-spring-mvc) |\n| 58  | [How do you implement file download functionality in Spring MVC?](#58-how-do-you-implement-file-download-functionality-in-spring-mvc) |\n| 59  | [How do you configure a custom exception handler in Spring MVC?](#59-how-do-you-configure-a-custom-exception-handler-in-spring-mvc) |\n| 60  | [What is the use of @RestControllerAdvice annotation?](#60-what-is-the-use-of-restcontrolleradvice-annotation) |\n| 61  | [How do you integrate Spring MVC with Hibernate?](#61-how-do-you-integrate-spring-mvc-with-hibernate) |\n| 62  | [Explain the process of handling multipart requests in Spring MVC.](#62-explain-the-process-of-handling-multipart-requests-in-spring-mvc) |\n| 63  | [How do you configure a custom argument resolver in Spring MVC?](#63-how-do-you-configure-a-custom-argument-resolver-in-spring-mvc) |\n| 64  | [What is the role of ContentNegotiationManager in Spring MVC?](#64-what-is-the-role-of-contentnegotiationmanager-in-spring-mvc) |\n| 65  | [How do you implement HATEOAS in a Spring MVC application?](#65-how-do-you-implement-hateoas-in-a-spring-mvc-application) |\n| 66  | [How do you configure a custom handler method return value handler in Spring MVC?](#66-how-do-you-configure-a-custom-handler-method-return-value-handler-in-spring-mvc) |\n| 67  | [Explain the process of configuring Spring MVC with XML-based configuration.](#67-explain-the-process-of-configuring-spring-mvc-with-xml-based-configuration) |\n| 68  | [How do you handle JSONP requests in Spring MVC?](#68-how-do-you-handle-jsonp-requests-in-spring-mvc) |\n| 69  | [How do you configure a custom view in Spring MVC?](#69-how-do-you-configure-a-custom-view-in-spring-mvc) |\n| 70  | [What is the role of HandlerAdapter in Spring MVC?](#70-what-is-the-role-of-handleradapter-in-spring-mvc) |\n| 71  | [How do you configure a custom model attribute in Spring MVC?](#71-how-do-you-configure-a-custom-model-attribute-in-spring-mvc) |\n| 72  | [How do you implement server-sent events (SSE) in a Spring MVC application?](#72-how-do-you-implement-server-sent-events-sse-in-a-spring-mvc-application) |\n| 73  | [How do you configure a custom form handler in Spring MVC?](#73-how-do-you-configure-a-custom-form-handler-in-spring-mvc) |\n| 74  | [What is the use of @JsonView annotation in Spring MVC?](#74-what-is-the-use-of-jsonview-annotation-in-spring-mvc) |\n| 75  | [How do you implement OAuth2 authentication in a Spring MVC application?](#75-how-do-you-implement-oauth2-authentication-in-a-spring-mvc-application) |\n\n## Spring Data JPA\n### Table of Contents\n### Level : Spring Data JPA Easy\n| No. | Questions |\n| --- | --------- |\n| 1   | [What is Spring Data JPA?](#1-what-is-spring-data-jpa) |\n| 2   | [What is the purpose of the `@Entity` annotation in JPA?](#2-what-is-the-purpose-of-the-entity-annotation-in-jpa) |\n| 3   | [What is an EntityManager in JPA?](#3-what-is-an-entitymanager-in-jpa) |\n| 4   | [What is the role of the `@Id` annotation in JPA?](#4-what-is-the-role-of-the-id-annotation-in-jpa) |\n| 5   | [How do you define a primary key in a JPA entity?](#5-how-do-you-define-a-primary-key-in-a-jpa-entity) |\n| 6   | [What is the difference between `findById` and `getOne` methods in JPA?](#6-what-is-the-difference-between-findbyid-and-getone-methods-in-jpa) |\n| 7   | [What is the purpose of the `@Table` annotation in JPA?](#7-what-is-the-purpose-of-the-table-annotation-in-jpa) |\n| 8   | [Explain the difference between `@Column` and `@JoinColumn`.](#8-explain-the-difference-between-column-and-joincolumn) |\n| 9   | [What is the role of the `@GeneratedValue` annotation in JPA?](#9-what-is-the-role-of-the-generatedvalue-annotation-in-jpa) |\n| 10  | [What is the default fetch type for `@OneToMany` and `@ManyToOne` relationships in JPA?](#10-what-is-the-default-fetch-type-for-onetomany-and-manytoone-relationships-in-jpa) |\n| 11  | [How do you define a one-to-many relationship in JPA?](#11-how-do-you-define-a-one-to-many-relationship-in-jpa) |\n| 12  | [What is a repository in Spring Data JPA?](#12-what-is-a-repository-in-spring-data-jpa) |\n| 13  | [What is the purpose of the `@Repository` annotation in Spring Data JPA?](#13-what-is-the-purpose-of-the-repository-annotation-in-spring-data-jpa) |\n| 14  | [How do you create a custom query in Spring Data JPA?](#14-how-do-you-create-a-custom-query-in-spring-data-jpa) |\n| 15  | [What is the purpose of the `@Query` annotation in Spring Data JPA?](#15-what-is-the-purpose-of-the-query-annotation-in-spring-data-jpa) |\n| 16  | [What is a JPQL?](#16-what-is-a-jpql) |\n| 17  | [What is the difference between JPQL and SQL?](#17-what-is-the-difference-between-jpql-and-sql) |\n| 18  | [What is the purpose of the `@Modifying` annotation in Spring Data JPA?](#18-what-is-the-purpose-of-the-modifying-annotation-in-spring-data-jpa) |\n| 19  | [How do you handle transactions in Spring Data JPA?](#19-how-do-you-handle-transactions-in-spring-data-jpa) |\n| 20  | [What is the `@Transactional` annotation used for in Spring Data JPA?](#20-what-is-the-transactional-annotation-used-for-in-spring-data-jpa) |\n| 21  | [How do you paginate results in Spring Data JPA?](#21-how-do-you-paginate-results-in-spring-data-jpa) |\n| 22  | [What is the `Pageable` interface in Spring Data JPA?](#22-what-is-the-pageable-interface-in-spring-data-jpa) |\n| 23  | [What is the `Page` interface in Spring Data JPA?](#23-what-is-the-page-interface-in-spring-data-jpa) |\n| 24  | [How do you sort results in Spring Data JPA?](#24-how-do-you-sort-results-in-spring-data-jpa) |\n| 25  | [What is a derived query method in Spring Data JPA?](#25-what-is-a-derived-query-method-in-spring-data-jpa) |\n| 26  | [What is the purpose of the `@NamedQuery` annotation in JPA?](#26-what-is-the-purpose-of-the-namedquery-annotation-in-jpa) |\n| 27  | [What is an entity lifecycle in JPA?](#27-what-is-an-entity-lifecycle-in-jpa) |\n| 28  | [What are the different states of an entity in JPA?](#28-what-are-the-different-states-of-an-entity-in-jpa) |\n| 29  | [What is the purpose of the `@PrePersist` annotation in JPA?](#29-what-is-the-purpose-of-the-prepersist-annotation-in-jpa) |\n| 30  | [What is the purpose of the `@PostPersist` annotation in JPA?](#30-what-is-the-purpose-of-the-postpersist-annotation-in-jpa) |\n| 31  | [What is the purpose of the `@PreUpdate` annotation in JPA?](#31-what-is-the-purpose-of-the-preupdate-annotation-in-jpa) |\n| 32  | [What is the purpose of the `@PostUpdate` annotation in JPA?](#32-what-is-the-purpose-of-the-postupdate-annotation-in-jpa) |\n| 33  | [What is the purpose of the `@PreRemove` annotation in JPA?](#33-what-is-the-purpose-of-the-preremove-annotation-in-jpa) |\n| 34  | [What is the purpose of the `@PostRemove` annotation in JPA?](#34-what-is-the-purpose-of-the-postremove-annotation-in-jpa) |\n| 35  | [What is the purpose of the `@PostLoad` annotation in JPA?](#35-what-is-the-purpose-of-the-postload-annotation-in-jpa) |\n\n### Level : Spring Data JPA Medium\n| No. | Questions |\n| --- | --------- |\n| 36  | [Explain the different types of primary key generation strategies in JPA.](#36-explain-the-different-types-of-primary-key-generation-strategies-in-jpa) |\n| 37  | [What is the difference between `@OneToMany` and `@ManyToMany` relationships in JPA?](#37-what-is-the-difference-between-onetomany-and-manytomany-relationships-in-jpa) |\n| 38  | [How do you handle bi-directional relationships in JPA?](#38-how-do-you-handle-bi-directional-relationships-in-jpa) |\n| 39  | [What is the `@MappedBy` attribute used for in JPA?](#39-what-is-the-mappedby-attribute-used-for-in-jpa) |\n| 40  | [What is the purpose of the `@ElementCollection` annotation in JPA?](#40-what-is-the-purpose-of-the-elementcollection-annotation-in-jpa) |\n| 41  | [How do you handle composite keys in JPA?](#41-how-do-you-handle-composite-keys-in-jpa) |\n| 42  | [What is the `@Embeddable` annotation used for in JPA?](#42-what-is-the-embeddable-annotation-used-for-in-jpa) |\n| 43  | [What is the purpose of the `@EmbeddedId` annotation in JPA?](#43-what-is-the-purpose-of-the-embeddedid-annotation-in-jpa) |\n| 44  | [What is the role of the `@Inheritance` annotation in JPA?](#44-what-is-the-role-of-the-inheritance-annotation-in-jpa) |\n| 45  | [Explain the different inheritance strategies in JPA.](#45-explain-the-different-inheritance-strategies-in-jpa) |\n| 46  | [What is the purpose of the `@DiscriminatorColumn` annotation in JPA?](#46-what-is-the-purpose-of-the-discriminatorcolumn-annotation-in-jpa) |\n| 47  | [What is the purpose of the `@DiscriminatorValue` annotation in JPA?](#47-what-is-the-purpose-of-the-discriminatorvalue-annotation-in-jpa) |\n| 48  | [What is the purpose of the `@SecondaryTable` annotation in JPA?](#48-what-is-the-purpose-of-the-secondarytable-annotation-in-jpa) |\n| 49  | [How do you define a native query in Spring Data JPA?](#49-how-do-you-define-a-native-query-in-spring-data-jpa) |\n| 50  | [What is the purpose of the `@NamedNativeQuery` annotation in JPA?](#50-what-is-the-purpose-of-the-namednativequery-annotation-in-jpa) |\n| 51  | [How do you handle optimistic locking in JPA?](#51-how-do-you-handle-optimistic-locking-in-jpa) |\n| 52  | [What is the purpose of the `@Version` annotation in JPA?](#52-what-is-the-purpose-of-the-version-annotation-in-jpa) |\n| 53  | [How do you handle pessimistic locking in JPA?](#53-how-do-you-handle-pessimistic-locking-in-jpa) |\n| 54  | [What is the `EntityGraph` in JPA and how is it used?](#54-what-is-the-entitygraph-in-jpa-and-how-is-it-used) |\n| 55  | [What are the different types of fetching strategies in JPA?](#55-what-are-the-different-types-of-fetching-strategies-in-jpa) |\n| 56  | [What is the difference between eager and lazy loading in JPA?](#56-what-is-the-difference-between-eager-and-lazy-loading-in-jpa) |\n| 57  | [How do you handle batch processing in Spring Data JPA?](#57-how-do-you-handle-batch-processing-in-spring-data-jpa) |\n| 58  | [What is the purpose of the `@BatchSize` annotation in JPA?](#58-what-is-the-purpose-of-the-batchsize-annotation-in-jpa) |\n| 59  | [How do you handle native SQL queries in Spring Data JPA?](#59-how-do-you-handle-native-sql-queries-in-spring-data-jpa) |\n| 60  | [What is the purpose of the `@SqlResultSetMapping` annotation in JPA?](#60-what-is-the-purpose-of-the-sqlresultsetmapping-annotation-in-jpa) |\n| 61  | [How do you handle auditing in Spring Data JPA?](#61-how-do-you-handle-auditing-in-spring-data-jpa) |\n| 62  | [What is the purpose of the `@CreatedDate` annotation in JPA?](#62-what-is-the-purpose-of-the-createddate-annotation-in-jpa) |\n| 63  | [What is the purpose of the `@LastModifiedDate` annotation in JPA?](#63-what-is-the-purpose-of-the-lastmodifieddate-annotation-in-jpa) |\n| 64  | [What is the purpose of the `@CreatedBy` annotation in JPA?](#64-what-is-the-purpose-of-the-createdby-annotation-in-jpa) |\n| 65  | [What is the purpose of the `@LastModifiedBy` annotation in JPA?](#65-what-is-the-purpose-of-the-lastmodifiedby-annotation-in-jpa) |\n\n### Level : Spring Data JPA Hard\n| No. | Questions |\n| --- | --------- |\n| 66  | [Explain the concept of entity graph in JPA and how it can be used to optimize performance.](#66-explain-the-concept-of-entity-graph-in-jpa-and-how-it-can-be-used-to-optimize-performance) |\n| 67  | [How do you handle dynamic queries in Spring Data JPA?](#67-how-do-you-handle-dynamic-queries-in-spring-data-jpa) |\n| 68  | [What is the role of the `Criteria API` in JPA?](#68-what-is-the-role-of-the-criteria-api-in-jpa) |\n| 69  | [How do you use the `Criteria API` to create dynamic queries in JPA?](#69-how-do-you-use-the-criteria-api-to-create-dynamic-queries-in-jpa) |\n| 70  | [What is the purpose of the `Specification` interface in Spring Data JPA?](#70-what-is-the-purpose-of-the-specification-interface-in-spring-data-jpa) |\n| 71  | [How do you use the `Specification` interface to create dynamic queries in JPA?](#71-how-do-you-use-the-specification-interface-to-create-dynamic-queries-in-jpa) |\n| 72  | [What is the purpose of the `@Cacheable` annotation in JPA?](#72-what-is-the-purpose-of-the-cacheable-annotation-in-jpa) |\n| 73  | [How do you configure second-level cache in JPA?](#73-how-do-you-configure-second-level-cache-in-jpa) |\n| 74  | [What is the difference between first-level and second-level cache in JPA?](#74-what-is-the-difference-between-first-level-and-second-level-cache-in-jpa) |\n| 75  | [Explain the concept of dirty checking in JPA and how it works.](#75-explain-the-concept-of-dirty-checking-in-jpa-and-how-it-works) |\n| 76  | [Explain the concept of cascade types in JPA and how they affect entity relationships.](#76-explain-the-concept-of-cascade-types-in-jpa-and-how-they-affect-entity-relationships) |\n| 77  | [What are the different cascade types available in JPA and when would you use each?](#77-what-are-the-different-cascade-types-available-in-jpa-and-when-would-you-use-each) |\n| 78  | [How do you handle orphan removal in JPA and what is the purpose of the `@OneToMany(orphanRemoval = true)` annotation?](#78-how-do-you-handle-orphan-removal-in-jpa-and-what-is-the-purpose-of-the-onetomanyorphanremoval--true-annotation) |\n| 79  | [What are the different types of entity graphs (attribute node, subgraph) in JPA and how are they used?](#79-what-are-the-different-types-of-entity-graphs-attribute-node-subgraph-in-jpa-and-how-are-they-used) |\n| 80  | [How do you optimize performance using Fetch Joins in JPQL?](#80-how-do-you-optimize-performance-using-fetch-joins-in-jpql) |\n| 81  | [What is the N+1 select problem in JPA and how can it be mitigated?](#81-what-is-the-n1-select-problem-in-jpa-and-how-can-it-be-mitigated) |\n| 82  | [Explain the purpose of the `@EntityListeners` annotation and how it is used in auditing.](#82-explain-the-purpose-of-the-entitylisteners-annotation-and-how-it-is-used-in-auditing) |\n| 83  | [How do you handle multi-tenancy in JPA and what are the different strategies available?](#83-how-do-you-handle-multi-tenancy-in-jpa-and-what-are-the-different-strategies-available) |\n| 84  | [How do you configure and use the `@SequenceGenerator` and `@TableGenerator` annotations in JPA?](#84-how-do-you-configure-and-use-the-sequencegenerator-and-tablegenerator-annotations-in-jpa) |\n| 85  | [What is the purpose of the `@Converter` annotation in JPA and how do you use it to create custom converters?](#85-what-is-the-purpose-of-the-converter-annotation-in-jpa-and-how-do-you-use-it-to-create-custom-converters) |\n| 86  | [How do you handle database migrations in a Spring Data JPA application?](#86-how-do-you-handle-database-migrations-in-a-spring-data-jpa-application) |\n| 87  | [What are the key considerations when implementing a custom repository in Spring Data JPA?](#87-what-are-the-key-considerations-when-implementing-a-custom-repository-in-spring-data-jpa) |\n| 88  | [How do you manage database connection pooling in a Spring Data JPA application?](#88-how-do-you-manage-database-connection-pooling-in-a-spring-data-jpa-application) |\n| 89  | [What is the role of the `@SecondaryTable` annotation in JPA and how do you use it to map an entity to multiple tables?](#89-what-is-the-role-of-the-secondarytable-annotation-in-jpa-and-how-do-you-use-it-to-map-an-entity-to-multiple-tables) |\n| 90  | [Explain the concept of `Entity Detachment` in JPA and how it affects the persistence context.](#90-explain-the-concept-of-entity-detachment-in-jpa-and-how-it-affects-the-persistence-context) |\n| 91  | [How do you implement soft deletes in a Spring Data JPA application?](#91-how-do-you-implement-soft-deletes-in-a-spring-data-jpa-application) |\n| 92  | [What are the pros and cons of using `EntityManager` directly versus using Spring Data JPA repositories?](#92-what-are-the-pros-and-cons-of-using-entitymanager-directly-versus-using-spring-data-jpa-repositories) |\n| 93  | [How do you handle hierarchical data structures (e.g., trees, graphs) in JPA?](#93-how-do-you-handle-hierarchical-data-structures-eg-trees-graphs-in-jpa) |\n| 94  | [Explain the concept of database sharding and how it can be implemented in a Spring Data JPA application.](#94-explain-the-concept-of-database-sharding-and-how-it-can-be-implemented-in-a-spring-data-jpa-application) |\n| 95  | [What are the best practices for managing entity relationships and avoiding circular dependencies in JPA?](#95-what-are-the-best-practices-for-managing-entity-relationships-and-avoiding-circular-dependencies-in-jpa) |\n| 96  | [How do you handle large data sets and pagination efficiently in a Spring Data JPA application?](#96-how-do-you-handle-large-data-sets-and-pagination-efficiently-in-a-spring-data-jpa-application) |\n| 97  | [Explain the different types of joins (inner, outer, cross) in JPQL and provide examples of when to use each.](#97-explain-the-different-types-of-joins-inner-outer-cross-in-jpql-and-provide-examples-of-when-to-use-each) |\n| 98  | [How do you handle custom exception handling and error codes in a Spring Data JPA application?](#98-how-do-you-handle-custom-exception-handling-and-error-codes-in-a-spring-data-jpa-application) |\n| 99  | [What are the key differences between Hibernate and other JPA implementations like EclipseLink?](#99-what-are-the-key-differences-between-hibernate-and-other-jpa-implementations-like-eclipselink) |\n| 100 | [How do you integrate Spring Data JPA with other Spring projects like Spring Batch or Spring Integration?](#100-how-do-you-integrate-spring-data-jpa-with-other-spring-projects-like-spring-batch-or-spring-integration) |\n\n## Spring Security\n### Table of Contents\n### Level : Spring Security Easy\n| No. | Questions |\n| --- | --------- |\n| 1   | [What is Spring Security?](#1-what-is-spring-security) |\n| 2   | [How does Spring Security work?](#2-how-does-spring-security-work) |\n| 3   | [What is the default login URL in Spring Security?](#3-what-is-the-default-login-url-in-spring-security) |\n| 4   | [How do you configure HTTP Basic Authentication in Spring Security?](#4-how-do-you-configure-http-basic-authentication-in-spring-security) |\n| 5   | [What is the purpose of the `@EnableWebSecurity` annotation?](#5-what-is-the-purpose-of-the-enablewebsecurity-annotation) |\n| 6   | [How do you disable CSRF protection in Spring Security?](#6-how-do-you-disable-csrf-protection-in-spring-security) |\n| 7   | [What is a `UserDetailsService`?](#7-what-is-a-userdetailsservice) |\n| 8   | [How do you create a custom login form in Spring Security?](#8-how-do-you-create-a-custom-login-form-in-spring-security) |\n| 9   | [Explain the role of `PasswordEncoder` in Spring Security.](#9-explain-the-role-of-passwordencoder-in-spring-security) |\n| 10  | [How can you restrict access to a URL based on roles?](#10-how-can-you-restrict-access-to-a-url-based-on-roles) |\n| 11  | [What is the purpose of the `SecurityContext`?](#11-what-is-the-purpose-of-the-securitycontext) |\n| 12  | [How do you configure form-based authentication in Spring Security?](#12-how-do-you-configure-form-based-authentication-in-spring-security) |\n| 13  | [What is the default username and password in Spring Security if none is provided?](#13-what-is-the-default-username-and-password-in-spring-security-if-none-is-provided) |\n| 14  | [How do you implement logout functionality in Spring Security?](#14-how-do-you-implement-logout-functionality-in-spring-security) |\n| 15  | [What is the difference between `@Secured` and `@PreAuthorize`?](#15-what-is-the-difference-between-secured-and-preauthorize) |\n| 16  | [How do you secure a method in Spring Security?](#16-how-do-you-secure-a-method-in-spring-security) |\n| 17  | [What is the role of the `AuthenticationManager`?](#17-what-is-the-role-of-the-authenticationmanager) |\n| 18  | [How can you remember a user's login in Spring Security?](#18-how-can-you-remember-a-users-login-in-spring-security) |\n| 19  | [How do you configure LDAP authentication in Spring Security?](#19-how-do-you-configure-ldap-authentication-in-spring-security) |\n| 20  | [What is the purpose of the `UserDetails` interface?](#20-what-is-the-purpose-of-the-userdetails-interface) |\n| 21  | [How do you create a custom `UserDetailsService`?](#21-how-do-you-create-a-custom-userdetailsservice) |\n| 22  | [Explain the `GrantedAuthority` interface.](#22-explain-the-grantedauthority-interface) |\n| 23  | [How do you configure HTTPS in Spring Security?](#23-how-do-you-configure-https-in-spring-security) |\n| 24  | [What is the purpose of the `SecurityContextHolder`?](#24-what-is-the-purpose-of-the-securitycontextholder) |\n| 25  | [How do you handle session fixation attacks in Spring Security?](#25-how-do-you-handle-session-fixation-attacks-in-spring-security) |\n\n### Level : Spring Security Medium\n| No. | Questions |\n| --- | --------- |\n| 26  | [How does Spring Security integrate with the Spring MVC framework?](#26-how-does-spring-security-integrate-with-the-spring-mvc-framework) |\n| 27  | [Explain the concept of security filters in Spring Security.](#27-explain-the-concept-of-security-filters-in-spring-security) |\n| 28  | [How do you configure multiple authentication providers in Spring Security?](#28-how-do-you-configure-multiple-authentication-providers-in-spring-security) |\n| 29  | [How do you implement role-based access control in Spring Security?](#29-how-do-you-implement-role-based-access-control-in-spring-security) |\n| 30  | [What is the purpose of the `FilterChainProxy`?](#30-what-is-the-purpose-of-the-filterchainproxy) |\n| 31  | [How do you configure CORS in Spring Security?](#31-how-do-you-configure-cors-in-spring-security) |\n| 32  | [Explain how to secure REST APIs with Spring Security.](#32-explain-how-to-secure-rest-apis-with-spring-security) |\n| 33  | [How do you handle exceptions in Spring Security?](#33-how-do-you-handle-exceptions-in-spring-security) |\n| 34  | [How do you customize the access denied page in Spring Security?](#34-how-do-you-customize-the-access-denied-page-in-spring-security) |\n| 35  | [What is the role of `SecurityConfigurerAdapter`?](#35-what-is-the-role-of-securityconfigureradapter) |\n| 36  | [How do you secure a Spring Boot application with Spring Security?](#36-how-do-you-secure-a-spring-boot-application-with-spring-security) |\n| 37  | [Explain the `OAuth2` support in Spring Security.](#37-explain-the-oauth2-support-in-spring-security) |\n| 38  | [How do you configure JWT authentication in Spring Security?](#38-how-do-you-configure-jwt-authentication-in-spring-security) |\n| 39  | [What is the purpose of `HttpSecurity`?](#39-what-is-the-purpose-of-httpsecurity) |\n| 40  | [How do you secure WebSocket connections in Spring Security?](#40-how-do-you-secure-websocket-connections-in-spring-security) |\n| 41  | [How do you integrate Spring Security with Thymeleaf?](#41-how-do-you-integrate-spring-security-with-thymeleaf) |\n| 42  | [Explain the purpose of `@WithMockUser` in Spring Security testing.](#42-explain-the-purpose-of-withmockuser-in-spring-security-testing) |\n| 43  | [How do you configure a custom authentication provider in Spring Security?](#43-how-do-you-configure-a-custom-authentication-provider-in-spring-security) |\n| 44  | [How do you handle CSRF tokens in AJAX requests with Spring Security?](#44-how-do-you-handle-csrf-tokens-in-ajax-requests-with-spring-security) |\n| 45  | [What are the different types of authentication mechanisms supported by Spring Security?](#45-what-are-the-different-types-of-authentication-mechanisms-supported-by-spring-security) |\n| 46  | [How do you implement two-factor authentication in Spring Security?](#46-how-do-you-implement-two-factor-authentication-in-spring-security) |\n| 47  | [How do you configure security for a microservices architecture with Spring Security?](#47-how-do-you-configure-security-for-a-microservices-architecture-with-spring-security) |\n| 48  | [Explain the concept of security expressions in Spring Security.](#48-explain-the-concept-of-security-expressions-in-spring-security) |\n| 49  | [How do you implement single sign-on (SSO) with Spring Security?](#49-how-do-you-implement-single-sign-on-sso-with-spring-security) |\n| 50  | [How do you perform security testing in a Spring Security application?](#50-how-do-you-perform-security-testing-in-a-spring-security-application) |\n\n### Level : Spring Security Hard\n| No. | Questions |\n| --- | --------- |\n| 51  | [Explain the internals of the `DelegatingFilterProxy`.](#51-explain-the-internals-of-the-delegatingfilterproxy) |\n| 52  | [How does Spring Security handle authentication and authorization for reactive applications?](#52-how-does-spring-security-handle-authentication-and-authorization-for-reactive-applications) |\n| 53  | [How do you implement custom security filters in Spring Security?](#53-how-do-you-implement-custom-security-filters-in-spring-security) |\n| 54  | [Explain the `AbstractSecurityInterceptor` class.](#54-explain-the-abstractsecurityinterceptor-class) |\n| 55  | [How do you integrate Spring Security with OAuth2 and OpenID Connect?](#55-how-do-you-integrate-spring-security-with-oauth2-and-openid-connect) |\n| 56  | [How do you implement a custom `AccessDecisionManager`?](#56-how-do-you-implement-a-custom-accessdecisionmanager) |\n| 57  | [How do you configure security for a Spring Cloud Gateway?](#57-how-do-you-configure-security-for-a-spring-cloud-gateway) |\n| 58  | [Explain the `SecurityContextRepository` interface.](#58-explain-the-securitycontextrepository-interface) |\n| 59  | [How do you implement attribute-based access control (ABAC) in Spring Security?](#59-how-do-you-implement-attribute-based-access-control-abac-in-spring-security) |\n| 60  | [How do you integrate Spring Security with a third-party identity provider?](#60-how-do-you-integrate-spring-security-with-a-third-party-identity-provider) |\n| 61  | [How do you handle cross-origin resource sharing (CORS) in a Spring Security application?](#61-how-do-you-handle-cross-origin-resource-sharing-cors-in-a-spring-security-application) |\n| 62  | [Explain the concept of AOP-based method security in Spring Security.](#62-explain-the-concept-of-aop-based-method-security-in-spring-security) |\n| 63  | [How do you configure security for a multi-tenant application in Spring Security?](#63-how-do-you-configure-security-for-a-multi-tenant-application-in-spring-security) |\n| 64  | [How do you implement custom token-based authentication in Spring Security?](#64-how-do-you-implement-custom-token-based-authentication-in-spring-security) |\n| 65  | [Explain the `SecurityExpressionHandler` interface.](#65-explain-the-securityexpressionhandler-interface) |\n| 66  | [How do you handle password reset functionality in Spring Security?](#66-how-do-you-handle-password-reset-functionality-in-spring-security) |\n| 67  | [How do you secure a Spring WebFlux application with Spring Security?](#67-how-do-you-secure-a-spring-webflux-application-with-spring-security) |\n| 68  | [Explain the `ReactiveAuthenticationManager` interface.](#68-explain-the-reactiveauthenticationmanager-interface) |\n| 69  | [How do you implement security auditing in Spring Security?](#69-how-do-you-implement-security-auditing-in-spring-security) |\n| 70  | [How do you secure a Spring Boot Admin server with Spring Security?](#70-how-do-you-secure-a-spring-boot-admin-server-with-spring-security) |\n| 71  | [Explain the `SecurityEvaluationContextExtension` class.](#71-explain-the-securityevaluationcontextextension-class) |\n| 72  | [How do you configure security for a GraphQL API with Spring Security?](#72-how-do-you-configure-security-for-a-graphql-api-with-spring-security) |\n| 73  | [How do you implement security for a server-sent events (SSE) endpoint in Spring Security?](#73-how-do-you-implement-security-for-a-server-sent-events-sse-endpoint-in-spring-security) |\n| 74  | [Explain the `JwtAccessTokenConverter` class.](#74-explain-the-jwtaccesstokenconverter-class) |\n| 75  | [How do you handle security for a batch processing application with Spring Security?](#75-how-do-you-handle-security-for-a-batch-processing-application-with-spring-security) |\n\n## Spring AOP\n### Table of Contents\n### Level : Spring AOP Easy\n| No. | Questions |\n| --- | --------- |\n| 1   | [What does AOP stand for in Spring?](#1-what-does-aop-stand-for-in-spring) |\n| 2   | [What are the key concepts of AOP?](#2-what-are-the-key-concepts-of-aop) |\n| 3   | [What is a cross-cutting concern? Can you give an example?](#3-what-is-a-cross-cutting-concern-can-you-give-an-example) |\n| 4   | [What is a join point?](#4-what-is-a-join-point) |\n| 5   | [What is a pointcut?](#5-what-is-a-pointcut) |\n| 6   | [What is an advice?](#6-what-is-an-advice) |\n| 7   | [What are the different types of advice in Spring AOP?](#7-what-are-the-different-types-of-advice-in-spring-aop) |\n| 8   | [What is an aspect?](#8-what-is-an-aspect) |\n| 9   | [How do you define an aspect in Spring AOP?](#9-how-do-you-define-an-aspect-in-spring-aop) |\n| 10  | [What is a proxy in Spring AOP?](#10-what-is-a-proxy-in-spring-aop) |\n| 11  | [What is weaving in the context of AOP?](#11-what-is-weaving-in-the-context-of-aop) |\n| 12  | [What is the difference between Spring AOP and AspectJ?](#12-what-is-the-difference-between-spring-aop-and-aspectj) |\n| 13  | [How do you enable AOP in a Spring application?](#13-how-do-you-enable-aop-in-a-spring-application) |\n| 14  | [What is @Aspect annotation used for?](#14-what-is-aspect-annotation-used-for) |\n| 15  | [What is @Pointcut annotation used for?](#15-what-is-pointcut-annotation-used-for) |\n| 16  | [What is the use of @Before annotation?](#16-what-is-the-use-of-before-annotation) |\n| 17  | [What is the use of @After annotation?](#17-what-is-the-use-of-after-annotation) |\n| 18  | [What is the use of @AfterReturning annotation?](#18-what-is-the-use-of-afterreturning-annotation) |\n| 19  | [What is the use of @AfterThrowing annotation?](#19-what-is-the-use-of-afterthrowing-annotation) |\n| 20  | [What is the use of @Around annotation?](#20-what-is-the-use-of-around-annotation) |\n| 21  | [How do you define a pointcut expression?](#21-how-do-you-define-a-pointcut-expression) |\n| 22  | [What is the purpose of JoinPoint interface in Spring AOP?](#22-what-is-the-purpose-of-joinpoint-interface-in-spring-aop) |\n| 23  | [Can you use Spring AOP with Spring Boot?](#23-can-you-use-spring-aop-with-spring-boot) |\n| 24  | [How would you exclude a method from being advised?](#24-how-would-you-exclude-a-method-from-being-advised) |\n| 25  | [What are the limitations of Spring AOP?](#25-what-are-the-limitations-of-spring-aop) |\n\n### Level : Spring AOP Medium\n| No. | Questions |\n| --- | --------- |\n| 26  | [How does Spring AOP work internally?](#26-how-does-spring-aop-work-internally) |\n| 27  | [What is the difference between static and dynamic weaving?](#27-what-is-the-difference-between-static-and-dynamic-weaving) |\n| 28  | [What is the difference between compile-time and load-time weaving?](#28-what-is-the-difference-between-compile-time-and-load-time-weaving) |\n| 29  | [How do you implement a custom annotation for AOP?](#29-how-do-you-implement-a-custom-annotation-for-aop) |\n| 30  | [How can you control the order of multiple aspects?](#30-how-can-you-control-the-order-of-multiple-aspects) |\n| 31  | [How do you pass parameters to advice methods?](#31-how-do-you-pass-parameters-to-advice-methods) |\n| 32  | [Can you access the return value in @AfterReturning advice?](#32-can-you-access-the-return-value-in-afterreturning-advice) |\n| 33  | [What is the use of ProceedingJoinPoint in @Around advice?](#33-what-is-the-use-of-proceedingjoinpoint-in-around-advice) |\n| 34  | [How do you handle exceptions in AOP?](#34-how-do-you-handle-exceptions-in-aop) |\n| 35  | [How can you apply AOP to specific beans?](#35-how-can-you-apply-aop-to-specific-beans) |\n| 36  | [How do you define multiple pointcuts in a single aspect?](#36-how-do-you-define-multiple-pointcuts-in-a-single-aspect) |\n| 37  | [Can you use AOP with non-Spring managed beans?](#37-can-you-use-aop-with-non-spring-managed-beans) |\n| 38  | [What is the use of @DeclareParents annotation?](#38-what-is-the-use-of-declareparents-annotation) |\n| 39  | [How do you test AOP functionality?](#39-how-do-you-test-aop-functionality) |\n| 40  | [Can you use AOP to modify method arguments?](#40-can-you-use-aop-to-modify-method-arguments) |\n| 41  | [How can you measure method execution time using AOP?](#41-how-can-you-measure-method-execution-time-using-aop) |\n| 42  | [How do you disable AOP for a specific environment?](#42-how-do-you-disable-aop-for-a-specific-environment) |\n| 43  | [How do you combine multiple pointcut expressions?](#43-how-do-you-combine-multiple-pointcut-expressions) |\n| 44  | [What is the use of @EnableAspectJAutoProxy annotation?](#44-what-is-the-use-of-enableaspectjautoproxy-annotation) |\n| 45  | [How do you apply AOP to private methods?](#45-how-do-you-apply-aop-to-private-methods) |\n| 46  | [How do you use AOP to manage transactions?](#46-how-do-you-use-aop-to-manage-transactions) |\n| 47  | [What is the difference between @Aspect and @Component annotations?](#47-what-is-the-difference-between-aspect-and-component-annotations) |\n| 48  | [How do you implement a logging aspect?](#48-how-do-you-implement-a-logging-aspect) |\n| 49  | [How do you use AOP to handle security concerns?](#49-how-do-you-use-aop-to-handle-security-concerns) |\n| 50  | [How do you use AOP to handle caching?](#50-how-do-you-use-aop-to-handle-caching) |\n\n### Level : Spring AOP Hard\n| No. | Questions |\n| --- | --------- |\n| 51  | [How does Spring AOP integrate with AspectJ?](#51-how-does-spring-aop-integrate-with-aspectj) |\n| 52  | [What are AspectJ annotations and how are they different from Spring AOP annotations?](#52-what-are-aspectj-annotations-and-how-are-they-different-from-spring-aop-annotations) |\n| 53  | [How do you perform load-time weaving with AspectJ in a Spring application?](#53-how-do-you-perform-load-time-weaving-with-aspectj-in-a-spring-application) |\n| 54  | [What is the @AspectJ style of declaring aspects?](#54-what-is-the-aspectj-style-of-declaring-aspects) |\n| 55  | [How do you use @Configurable annotation in AspectJ?](#55-how-do-you-use-configurable-annotation-in-aspectj) |\n| 56  | [How do you implement aspect precedence in AspectJ?](#56-how-do-you-implement-aspect-precedence-in-aspectj) |\n| 57  | [How do you use @DeclareError and @DeclareWarning annotations in AspectJ?](#57-how-do-you-use-declareerror-and-declarewarning-annotations-in-aspectj) |\n| 58  | [How do you use AOP with asynchronous methods?](#58-how-do-you-use-aop-with-asynchronous-methods) |\n| 59  | [How do you use AOP to implement a retry mechanism?](#59-how-do-you-use-aop-to-implement-a-retry-mechanism) |\n| 60  | [How do you manage circular dependencies in AOP?](#60-how-do-you-manage-circular-dependencies-in-aop) |\n| 61  | [How do you use AOP to enforce coding standards?](#61-how-do-you-use-aop-to-enforce-coding-standards) |\n| 62  | [How do you use AOP for monitoring and profiling?](#62-how-do-you-use-aop-for-monitoring-and-profiling) |\n| 63  | [How do you use AOP to implement a feature toggle?](#63-how-do-you-use-aop-to-implement-a-feature-toggle) |\n| 64  | [How do you use AOP to implement a rate limiter?](#64-how-do-you-use-aop-to-implement-a-rate-limiter) |\n| 65  | [How do you use AOP to implement a circuit breaker?](#65-how-do-you-use-aop-to-implement-a-circuit-breaker) |\n| 66  | [How do you use AOP to implement dependency injection?](#66-how-do-you-use-aop-to-implement-dependency-injection) |\n| 67  | [What is the use of @AspectJAutoProxyCreator?](#67-what-is-the-use-of-aspectjautoproxycreator) |\n| 68  | [How do you create a custom pointcut expression?](#68-how-do-you-create-a-custom-pointcut-expression) |\n| 69  | [How do you handle concurrency issues in AOP?](#69-how-do-you-handle-concurrency-issues-in-aop) |\n| 70  | [How do you use AOP for dynamic proxy creation?](#70-how-do-you-use-aop-for-dynamic-proxy-creation) |\n| 71  | [How do you use AOP to handle resource management?](#71-how-do-you-use-aop-to-handle-resource-management) |\n| 72  | [How do you use AOP to implement data validation?](#72-how-do-you-use-aop-to-implement-data-validation) |\n| 73  | [How do you use AOP to handle method chaining?](#73-how-do-you-use-aop-to-handle-method-chaining) |\n| 74  | [How do you optimize AOP performance?](#74-how-do-you-optimize-aop-performance) |\n| 75  | [How do you debug AOP issues in a Spring application?](#75-how-do-you-debug-aop-issues-in-a-spring-application) |\n\n## Spring Cloud\n### Table of Contents\n### Level : Spring Cloud Easy\n| No. | Questions |\n| --- | --------- |\n| 1   | [What is Spring Cloud, and how is it different from Spring Boot?](#1-what-is-spring-cloud-and-how-is-it-different-from-spring-boot) |\n| 2   | [Explain the concept of microservices.](#2-explain-the-concept-of-microservices) |\n| 3   | [What is Spring Cloud Config, and how does it work?](#3-what-is-spring-cloud-config-and-how-does-it-work) |\n| 4   | [How do you use Spring Cloud Config Server to manage configuration for microservices?](#4-how-do-you-use-spring-cloud-config-server-to-manage-configuration-for-microservices) |\n| 5   | [What is the role of Eureka in Spring Cloud?](#5-what-is-the-role-of-eureka-in-spring-cloud) |\n| 6   | [How do you register a service with Eureka?](#6-how-do-you-register-a-service-with-eureka) |\n| 7   | [What is Zuul, and how does it work in Spring Cloud?](#7-what-is-zuul-and-how-does-it-work-in-spring-cloud) |\n| 8   | [How do you implement a Zuul API Gateway?](#8-how-do-you-implement-a-zuul-api-gateway) |\n| 9   | [What is Spring Cloud Feign, and what are its advantages?](#9-what-is-spring-cloud-feign-and-what-are-its-advantages) |\n| 10  | [How do you use Feign clients to call other microservices?](#10-how-do-you-use-feign-clients-to-call-other-microservices) |\n| 11  | [What is Hystrix, and how does it help in fault tolerance?](#11-what-is-hystrix-and-how-does-it-help-in-fault-tolerance) |\n| 12  | [How do you implement Hystrix in a Spring Cloud application?](#12-how-do-you-implement-hystrix-in-a-spring-cloud-application) |\n| 13  | [Explain the circuit breaker pattern and its benefits.](#13-explain-the-circuit-breaker-pattern-and-its-benefits) |\n| 14  | [What is Spring Cloud Sleuth, and how does it help in distributed tracing?](#14-what-is-spring-cloud-sleuth-and-how-does-it-help-in-distributed-tracing) |\n| 15  | [How do you enable and use Spring Cloud Sleuth?](#15-how-do-you-enable-and-use-spring-cloud-sleuth) |\n| 16  | [What is Spring Cloud Bus, and how does it work?](#16-what-is-spring-cloud-bus-and-how-does-it-work) |\n| 17  | [How do you use Spring Cloud Bus to propagate configuration changes?](#17-how-do-you-use-spring-cloud-bus-to-propagate-configuration-changes) |\n| 18  | [What is a Config Server, and how do you set it up?](#18-what-is-a-config-server-and-how-do-you-set-it-up) |\n| 19  | [How do you secure a Spring Cloud Config Server?](#19-how-do-you-secure-a-spring-cloud-config-server) |\n| 20  | [What is the purpose of Spring Cloud Stream?](#20-what-is-the-purpose-of-spring-cloud-stream) |\n| 21  | [How do you use Spring Cloud Stream to build event-driven microservices?](#21-how-do-you-use-spring-cloud-stream-to-build-event-driven-microservices) |\n| 22  | [What is Ribbon, and how does it achieve client-side load balancing?](#22-what-is-ribbon-and-how-does-it-achieve-client-side-load-balancing) |\n| 23  | [How do you integrate Ribbon with Eureka?](#23-how-do-you-integrate-ribbon-with-eureka) |\n| 24  | [What is Spring Cloud Gateway, and how is it different from Zuul?](#24-what-is-spring-cloud-gateway-and-how-is-it-different-from-zuul) |\n| 25  | [How do you implement rate limiting in Spring Cloud Gateway?](#25-how-do-you-implement-rate-limiting-in-spring-cloud-gateway) |\n\n### Table of Contents\n### Level : Spring Cloud Medium\n| No. | Questions |\n| --- | --------- |\n| 26  | [How do you handle configuration changes dynamically in Spring Cloud?](#26-how-do-you-handle-configuration-changes-dynamically-in-spring-cloud) |\n| 27  | [What are the different ways to configure a Spring Cloud application?](#27-what-are-the-different-ways-to-configure-a-spring-cloud-application) |\n| 28  | [How do you manage secrets and sensitive data in Spring Cloud Config?](#28-how-do-you-manage-secrets-and-sensitive-data-in-spring-cloud-config) |\n| 29  | [Explain the differences between client-side and server-side load balancing.](#29-explain-the-differences-between-client-side-and-server-side-load-balancing) |\n| 30  | [How do you implement a custom load-balancing strategy with Ribbon?](#30-how-do-you-implement-a-custom-load-balancing-strategy-with-ribbon) |\n| 31  | [Describe the fallback mechanism in Hystrix.](#31-describe-the-fallback-mechanism-in-hystrix) |\n| 32  | [How do you configure a global fallback method in Hystrix?](#32-how-do-you-configure-a-global-fallback-method-in-hystrix) |\n| 33  | [What is the difference between a Hystrix command and a Hystrix observable command?](#33-what-is-the-difference-between-a-hystrix-command-and-a-hystrix-observable-command) |\n| 34  | [How do you monitor Hystrix metrics?](#34-how-do-you-monitor-hystrix-metrics) |\n| 35  | [What are Spring Cloud Sleuth's span and trace IDs?](#35-what-are-spring-cloud-sleuths-span-and-trace-ids) |\n| 36  | [How do you propagate tracing information across microservices with Spring Cloud Sleuth?](#36-how-do-you-propagate-tracing-information-across-microservices-with-spring-cloud-sleuth) |\n| 37  | [Explain the role of Zipkin in distributed tracing.](#37-explain-the-role-of-zipkin-in-distributed-tracing) |\n| 38  | [How do you integrate Spring Cloud Sleuth with Zipkin?](#38-how-do-you-integrate-spring-cloud-sleuth-with-zipkin) |\n| 39  | [What are the advantages of using Spring Cloud Stream over traditional messaging?](#39-what-are-the-advantages-of-using-spring-cloud-stream-over-traditional-messaging) |\n| 40  | [How do you implement a custom binder in Spring Cloud Stream?](#40-how-do-you-implement-a-custom-binder-in-spring-cloud-stream) |\n| 41  | [What is the difference between @StreamListener and @EnableBinding?](#41-what-is-the-difference-between-streamlistener-and-enablebinding) |\n| 42  | [How do you achieve data consistency in microservices using Spring Cloud Stream?](#42-how-do-you-achieve-data-consistency-in-microservices-using-spring-cloud-stream) |\n| 43  | [Explain the difference between Spring Cloud Bus and Spring Cloud Stream.](#43-explain-the-difference-between-spring-cloud-bus-and-spring-cloud-stream) |\n| 44  | [How do you implement distributed transactions in Spring Cloud?](#44-how-do-you-implement-distributed-transactions-in-spring-cloud) |\n| 45  | [Describe the role of Spring Cloud Consul.](#45-describe-the-role-of-spring-cloud-consul) |\n| 46  | [How do you use Consul for service discovery and configuration management?](#46-how-do-you-use-consul-for-service-discovery-and-configuration-management) |\n| 47  | [What is Spring Cloud Kubernetes, and how does it help in deploying microservices to Kubernetes?](#47-what-is-spring-cloud-kubernetes-and-how-does-it-help-in-deploying-microservices-to-kubernetes) |\n| 48  | [How do you configure Spring Cloud applications for Kubernetes?](#48-how-do-you-configure-spring-cloud-applications-for-kubernetes) |\n| 49  | [Explain the concept of service mesh and its benefits.](#49-explain-the-concept-of-service-mesh-and-its-benefits) |\n| 50  | [How do you integrate Spring Cloud applications with Istio?](#50-how-do-you-integrate-spring-cloud-applications-with-istio) |\n| 51  | [What is the difference between Spring Cloud Gateway and Spring Cloud Zuul?](#51-what-is-the-difference-between-spring-cloud-gateway-and-spring-cloud-zuul) |\n| 52  | [How do you implement security in Spring Cloud Gateway?](#52-how-do-you-implement-security-in-spring-cloud-gateway) |\n| 53  | [Describe the role of OAuth2 in securing microservices.](#53-describe-the-role-of-oauth2-in-securing-microservices) |\n| 54  | [How do you integrate Spring Security OAuth2 with Spring Cloud Gateway?](#54-how-do-you-integrate-spring-security-oauth2-with-spring-cloud-gateway) |\n| 55  | [Explain how to use Spring Cloud Contract for consumer-driven contracts.](#55-explain-how-to-use-spring-cloud-contract-for-consumer-driven-contracts) |\n\n### Table of Contents\n### Level : Spring Cloud Hard\n| No. | Questions |\n| --- | --------- |\n| 56  | [How do you implement a distributed caching strategy in Spring Cloud?](#56-how-do-you-implement-a-distributed-caching-strategy-in-spring-cloud) |\n| 57  | [Explain the CAP theorem and its relevance to Spring Cloud applications.](#57-explain-the-cap-theorem-and-its-relevance-to-spring-cloud-applications) |\n| 58  | [How do you handle eventual consistency in microservices?](#58-how-do-you-handle-eventual-consistency-in-microservices) |\n| 59  | [What are the challenges of using microservices, and how does Spring Cloud address them?](#59-what-are-the-challenges-of-using-microservices-and-how-does-spring-cloud-address-them) |\n| 60  | [How do you implement a custom Zuul filter?](#60-how-do-you-implement-a-custom-zuul-filter) |\n| 61  | [What are the different types of Zuul filters, and how do they work?](#61-what-are-the-different-types-of-zuul-filters-and-how-do-they-work) |\n| 62  | [How do you implement a custom plugin for Spring Cloud Gateway?](#62-how-do-you-implement-a-custom-plugin-for-spring-cloud-gateway) |\n| 63  | [Explain the importance of service registry in microservices architecture.](#63-explain-the-importance-of-service-registry-in-microservices-architecture) |\n| 64  | [How do you implement a custom service registry with Spring Cloud?](#64-how-do-you-implement-a-custom-service-registry-with-spring-cloud) |\n| 65  | [Describe a scenario where you would use Spring Cloud Sleuth without Zipkin.](#65-describe-a-scenario-where-you-would-use-spring-cloud-sleuth-without-zipkin) |\n| 66  | [How do you monitor and troubleshoot performance issues in a Spring Cloud application?](#66-how-do-you-monitor-and-troubleshoot-performance-issues-in-a-spring-cloud-application) |\n| 67  | [What is the role of Prometheus and Grafana in monitoring Spring Cloud applications?](#67-what-is-the-role-of-prometheus-and-grafana-in-monitoring-spring-cloud-applications) |\n| 68  | [How do you configure Spring Cloud applications for high availability?](#68-how-do-you-configure-spring-cloud-applications-for-high-availability) |\n| 69  | [Explain the concept of blue-green deployment and how to implement it with Spring Cloud.](#69-explain-the-concept-of-blue-green-deployment-and-how-to-implement-it-with-spring-cloud) |\n| 70  | [How do you handle versioning of microservices in Spring Cloud?](#70-how-do-you-handle-versioning-of-microservices-in-spring-cloud) |\n| 71  | [What is Canary release, and how do you implement it with Spring Cloud?](#71-what-is-canary-release-and-how-do-you-implement-it-with-spring-cloud) |\n| 72  | [How do you implement a global error handling strategy in Spring Cloud Gateway?](#72-how-do-you-implement-a-global-error-handling-strategy-in-spring-cloud-gateway) |\n| 73  | [Explain the importance of observability in microservices and how Spring Cloud helps achieve it.](#73-explain-the-importance-of-observability-in-microservices-and-how-spring-cloud-helps-achieve-it) |\n| 74  | [How do you implement distributed logging in Spring Cloud applications?](#74-how-do-you-implement-distributed-logging-in-spring-cloud-applications) |\n| 75  | [Describe a complex use case where you combined multiple Spring Cloud components to solve a problem.](#75-describe-a-complex-use-case-where-you-combined-multiple-spring-cloud-components-to-solve-a-problem) |\n\n## Spring Batch\n### Table of Contents\n| No. | Questions |\n| --- | --------- |\n| 1   | [What is Spring Batch and why is it used?](#1-what-is-spring-batch-and-why-is-it-used) |\n| 2   | [Describe the architecture of Spring Batch.](#2-describe-the-architecture-of-spring-batch) |\n| 3   | [What are the main components of a Spring Batch job?](#3-what-are-the-main-components-of-a-spring-batch-job) |\n| 4   | [Explain the concept of a Job and a Step in Spring Batch.](#4-explain-the-concept-of-a-job-and-a-step-in-spring-batch) |\n| 5   | [What is a JobRepository in Spring Batch?](#5-what-is-a-jobrepository-in-spring-batch) |\n| 6   | [How is transaction management handled in Spring Batch?](#6-how-is-transaction-management-handled-in-spring-batch) |\n| 7   | [What is a JobLauncher and how does it work?](#7-what-is-a-joblauncher-and-how-does-it-work) |\n| 8   | [Explain the role of JobParameters in Spring Batch.](#8-explain-the-role-of-jobparameters-in-spring-batch) |\n| 9   | [What is the difference between a Tasklet and a Chunk-oriented processing in Spring Batch?](#9-what-is-the-difference-between-a-tasklet-and-a-chunk-oriented-processing-in-spring-batch) |\n| 10  | [How can you configure a Step in Spring Batch?](#10-how-can-you-configure-a-step-in-spring-batch) |\n| 11  | [What are ItemReader, ItemProcessor, and ItemWriter in Spring Batch?](#11-what-are-itemreader-itemprocessor-and-itemwriter-in-spring-batch) |\n| 12  | [How do you handle job execution states in Spring Batch?](#12-how-do-you-handle-job-execution-states-in-spring-batch) |\n| 13  | [What is a JobExecutionListener and how is it used?](#13-what-is-a-jobexecutionlistener-and-how-is-it-used) |\n| 14  | [How do you handle job restarts in Spring Batch?](#14-how-do-you-handle-job-restarts-in-spring-batch) |\n| 15  | [What are the different ways to configure Spring Batch jobs?](#15-what-are-the-different-ways-to-configure-spring-batch-jobs) |\n| 16  | [How do you implement skip and retry logic in Spring Batch?](#16-how-do-you-implement-skip-and-retry-logic-in-spring-batch) |\n| 17  | [What are the different job status and exit status codes in Spring Batch?](#17-what-are-the-different-job-status-and-exit-status-codes-in-spring-batch) |\n| 18  | [Explain the concept of JobInstance and JobExecution in Spring Batch.](#18-explain-the-concept-of-jobinstance-and-jobexecution-in-spring-batch) |\n| 19  | [How do you manage job concurrency in Spring Batch?](#19-how-do-you-manage-job-concurrency-in-spring-batch) |\n| 20  | [What is the role of the StepExecutionListener?](#20-what-is-the-role-of-the-stepexecutionlistener) |\n| 21  | [How would you configure and use a FlatFileItemReader in Spring Batch?](#21-how-would-you-configure-and-use-a-flatfileitemreader-in-spring-batch) |\n| 22  | [How can you process XML files using Spring Batch?](#22-how-can-you-process-xml-files-using-spring-batch) |\n| 23  | [Describe how to handle exceptions in Spring Batch.](#23-describe-how-to-handle-exceptions-in-spring-batch) |\n| 24  | [Explain the role of the ExecutionContext in Spring Batch.](#24-explain-the-role-of-the-executioncontext-in-spring-batch) |\n| 25  | [How do you integrate Spring Batch with Spring Boot?](#25-how-do-you-integrate-spring-batch-with-spring-boot) |\n| 26  | [What are the benefits of using Spring Batch with Spring Boot?](#26-what-are-the-benefits-of-using-spring-batch-with-spring-boot) |\n| 27  | [How can you schedule Spring Batch jobs?](#27-how-can-you-schedule-spring-batch-jobs) |\n| 28  | [What are the best practices for designing Spring Batch jobs?](#28-what-are-the-best-practices-for-designing-spring-batch-jobs) |\n| 29  | [How do you monitor and manage Spring Batch jobs?](#29-how-do-you-monitor-and-manage-spring-batch-jobs) |\n| 30  | [Explain the role of the JobOperator in Spring Batch.](#30-explain-the-role-of-the-joboperator-in-spring-batch) |\n| 31  | [How can you partition a Spring Batch job?](#31-how-can-you-partition-a-spring-batch-job) |\n| 32  | [What is a CompositeItemProcessor and how is it used?](#32-what-is-a-compositeitemprocessor-and-how-is-it-used) |\n| 33  | [How do you implement a multi-threaded Step in Spring Batch?](#33-how-do-you-implement-a-multi-threaded-step-in-spring-batch) |\n| 34  | [What is the purpose of the Spring Batch Admin?](#34-what-is-the-purpose-of-the-spring-batch-admin) |\n| 35  | [How do you use the Spring Batch integration with Spring Cloud Data Flow?](#35-how-do-you-use-the-spring-batch-integration-with-spring-cloud-data-flow) |\n| 36  | [Explain the importance of the Spring Batch namespace configuration.](#36-explain-the-importance-of-the-spring-batch-namespace-configuration) |\n| 37  | [What is a StepScope and how is it used in Spring Batch?](#37-what-is-a-stepscope-and-how-is-it-used-in-spring-batch) |\n| 38  | [Describe how to implement a custom ItemReader.](#38-describe-how-to-implement-a-custom-itemreader) |\n| 39  | [How do you handle large data sets in Spring Batch?](#39-how-do-you-handle-large-data-sets-in-spring-batch) |\n| 40  | [How can you process database records using Spring Batch?](#40-how-can-you-process-database-records-using-spring-batch) |\n| 41  | [What is a StaxEventItemReader and how is it used?](#41-what-is-a-staxeventitemreader-and-how-is-it-used) |\n| 42  | [How do you manage job dependencies in Spring Batch?](#42-how-do-you-manage-job-dependencies-in-spring-batch) |\n| 43  | [Explain the concept of job parameters incrementer.](#43-explain-the-concept-of-job-parameters-incrementer) |\n| 44  | [How can you customize the JobLauncher?](#44-how-can-you-customize-the-joblauncher) |\n| 45  | [What are the different ways to stop a running job in Spring Batch?](#45-what-are-the-different-ways-to-stop-a-running-job-in-spring-batch) |\n| 46  | [How do you implement conditional flow in a Spring Batch job?](#46-how-do-you-implement-conditional-flow-in-a-spring-batch-job) |\n| 47  | [Describe the use of the SimpleJobLauncher.](#47-describe-the-use-of-the-simplejoblauncher) |\n| 48  | [How can you handle job execution failures in Spring Batch?](#48-how-can-you-handle-job-execution-failures-in-spring-batch) |\n| 49  | [How do you use annotations in Spring Batch configuration?](#49-how-do-you-use-annotations-in-spring-batch-configuration) |\n| 50  | [What are the core interfaces provided by Spring Batch?](#50-what-are-the-core-interfaces-provided-by-spring-batch) |\n\n## Spring Integration\n### Table of Contents\n| No. | Questions |\n| --- | --------- |\n| 1   | [What is Spring Integration? Explain the purpose and use cases of Spring Integration.](#1-what-is-spring-integration-explain-the-purpose-and-use-cases-of-spring-integration) |\n| 2   | [What are the main components of Spring Integration?](#2-what-are-the-main-components-of-spring-integration) |\n| 3   | [How does Spring Integration support messaging systems?](#3-how-does-spring-integration-support-messaging-systems) |\n| 4   | [Explain the concept of a Message in Spring Integration.](#4-explain-the-concept-of-a-message-in-spring-integration) |\n| 5   | [What is a Message Channel in Spring Integration?](#5-what-is-a-message-channel-in-spring-integration) |\n| 6   | [Differentiate between Direct Channel and Queue Channel.](#6-differentiate-between-direct-channel-and-queue-channel) |\n| 7   | [What are Message Endpoints?](#7-what-are-message-endpoints) |\n| 8   | [Explain the role of Message Transformers in Spring Integration.](#8-explain-the-role-of-message-transformers-in-spring-integration) |\n| 9   | [What are Message Routers?](#9-what-are-message-routers) |\n| 10  | [How do you configure a Message Filter in Spring Integration?](#10-how-do-you-configure-a-message-filter-in-spring-integration) |\n| 11  | [What is a Message Splitter?](#11-what-is-a-message-splitter) |\n| 12  | [Describe the use of a Message Aggregator.](#12-describe-the-use-of-a-message-aggregator) |\n| 13  | [How does Spring Integration support error handling?](#13-how-does-spring-integration-support-error-handling) |\n| 14  | [What is a Pollable Channel in Spring Integration?](#14-what-is-a-pollable-channel-in-spring-integration) |\n| 15  | [Explain the concept of a Channel Adapter.](#15-explain-the-concept-of-a-channel-adapter) |\n| 16  | [What are the different types of Channel Adapters?](#16-what-are-the-different-types-of-channel-adapters) |\n| 17  | [Describe the use of a Service Activator.](#17-describe-the-use-of-a-service-activator) |\n| 18  | [What is a Gateway in Spring Integration?](#18-what-is-a-gateway-in-spring-integration) |\n| 19  | [How do you configure a Gateway?](#19-how-do-you-configure-a-gateway) |\n| 20  | [Explain Inbound and Outbound Gateways.](#20-explain-inbound-and-outbound-gateways) |\n| 21  | [What is a Message Flow in Spring Integration?](#21-what-is-a-message-flow-in-spring-integration) |\n| 22  | [How do you implement Publish-Subscribe channels?](#22-how-do-you-implement-publish-subscribe-channels) |\n| 23  | [What is the role of a Message Selector?](#23-what-is-the-role-of-a-message-selector) |\n| 24  | [How can you integrate Spring Integration with JMS?](#24-how-can-you-integrate-spring-integration-with-jms) |\n| 25  | [Explain the use of SFTP/SCP adapters in Spring Integration.](#25-explain-the-use-of-sftp-scp-adapters-in-spring-integration) |\n| 26  | [How do you handle transactions in Spring Integration?](#26-how-do-you-handle-transactions-in-spring-integration) |\n| 27  | [What is a Bridge in Spring Integration?](#27-what-is-a-bridge-in-spring-integration) |\n| 28  | [Describe the concept of a Messaging Gateway Interface.](#28-describe-the-concept-of-a-messaging-gateway-interface) |\n| 29  | [What are the benefits of using Spring Integration over traditional messaging?](#29-what-are-the-benefits-of-using-spring-integration-over-traditional-messaging) |\n| 30  | [Explain the use of the `@MessagingGateway` annotation.](#30-explain-the-use-of-the-messaginggateway-annotation) |\n| 31  | [What is a Channel Interceptor?](#31-what-is-a-channel-interceptor) |\n| 32  | [How do you implement retry logic in Spring Integration?](#32-how-do-you-implement-retry-logic-in-spring-integration) |\n| 33  | [What is a Barrier in Spring Integration?](#33-what-is-a-barrier-in-spring-integration) |\n| 34  | [How do you use Spring Integration with RabbitMQ?](#34-how-do-you-use-spring-integration-with-rabbitmq) |\n| 35  | [Explain the concept of a Wire Tap.](#35-explain-the-concept-of-a-wire-tap) |\n| 36  | [What is a Control Bus in Spring Integration?](#36-what-is-a-control-bus-in-spring-integration) |\n| 37  | [How do you configure a Scatter-Gather pattern in Spring Integration?](#37-how-do-you-configure-a-scatter-gather-pattern-in-spring-integration) |\n| 38  | [Describe the role of a Payload in Spring Integration.](#38-describe-the-role-of-a-payload-in-spring-integration) |\n| 39  | [How do you use Spring Integration with Web Services?](#39-how-do-you-use-spring-integration-with-web-services) |\n| 40  | [What is the purpose of the IntegrationFlow?](#40-what-is-the-purpose-of-the-integrationflow) |\n| 41  | [How do you implement a custom transformer in Spring Integration?](#41-how-do-you-implement-a-custom-transformer-in-spring-integration) |\n| 42  | [What is an Executor Channel?](#42-what-is-an-executor-channel) |\n| 43  | [How do you implement a custom filter in Spring Integration?](#43-how-do-you-implement-a-custom-filter-in-spring-integration) |\n| 44  | [Describe the concept of a Delayer.](#44-describe-the-concept-of-a-delayer) |\n| 45  | [How do you monitor Spring Integration applications?](#45-how-do-you-monitor-spring-integration-applications) |\n| 46  | [What is the role of Integration Management in Spring Integration?](#46-what-is-the-role-of-integration-management-in-spring-integration) |\n| 47  | [How do you handle message headers in Spring Integration?](#47-how-do-you-handle-message-headers-in-spring-integration) |\n| 48  | [Explain the concept of a Message History.](#48-explain-the-concept-of-a-message-history) |\n| 49  | [How do you use Spring Integration with Kafka?](#49-how-do-you-use-spring-integration-with-kafka) |\n| 50  | [What are the best practices for designing Spring Integration flows?](#50-what-are-the-best-practices-for-designing-spring-integration-flows) |\n\n---\n\n# Spring Core Easy Interview Questions and Answers\n### 1. What is the Spring Framework?\n\nThe Spring Framework is an open-source application framework that provides comprehensive infrastructure support for developing Java applications. It was initially released in 2003 by Rod Johnson. Spring makes it easier to create enterprise-level applications by providing various modules and extensions to build robust and maintainable applications.\n\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 2. What are the advantages of using Spring Framework?\n\n- **Modularity**: Spring is divided into several modules, allowing developers to use only the parts they need.\n- **Dependency Injection**: Promotes loose coupling by allowing objects to be injected into other objects.\n- **Aspect-Oriented Programming (AOP)**: Helps separate cross-cutting concerns such as logging, security, and transaction management.\n- **Transaction Management**: Simplifies the management of transactions.\n- **Integration with Other Frameworks**: Easily integrates with other frameworks like Hibernate, JPA, and Struts.\n- **Testability**: Provides support for unit testing and integration testing.\n- **Community Support**: Large community and extensive documentation.\n\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 3. Explain Dependency Injection.\n\nDependency Injection (DI) is a design pattern that allows an object to be created and injected with its dependencies by an external entity. This promotes loose coupling between objects and enhances testability and maintainability.\n\n**Example:**\n\n```java\n// Service interface\npublic interface MessageService {\n    void sendMessage(String message, String receiver);\n}\n\n// Service implementation\npublic class EmailService implements MessageService {\n    @Override\n    public void sendMessage(String message, String receiver) {\n        System.out.println(\"Email sent to \" + receiver + \" with Message: \" + message);\n    }\n}\n\n// Consumer class\npublic class MyApplication {\n    private MessageService service;\n\n    // Constructor-based dependency injection\n    public MyApplication(MessageService service) {\n        this.service = service;\n    }\n\n    public void processMessage(String message, String receiver) {\n        service.sendMessage(message, receiver);\n    }\n}\n\n// Main class\npublic class MainApp {\n    public static void main(String[] args) {\n        // Injecting dependency\n        MessageService service = new EmailService();\n        MyApplication app = new MyApplication(service);\n        app.processMessage(\"Hello\", \"john@example.com\");\n    }\n}\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 4. What are the different types of Dependency Injection?\n\n- **Constructor Injection**: Dependencies are provided through a class constructor.\n- **Setter Injection**: Dependencies are provided through setter methods.\n- **Interface Injection**: Dependencies are provided through an interface method (less common).\n\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 5. What is the BeanFactory in Spring?\n\nBeanFactory is the root interface for accessing a Spring bean container. It provides the configuration framework and basic functionality for managing beans. BeanFactory is lightweight and is typically used in simple applications or scenarios where resources are limited.\n\n**Example:**\n\n```java\n// XML Configuration (beans.xml)\n\u003cbeans\u003e\n    \u003cbean id=\"myBean\" class=\"com.example.MyBean\"/\u003e\n\u003c/beans\u003e\n\n// Java Code\npublic class MainApp {\n    public static void main(String[] args) {\n        Resource resource = new ClassPathResource(\"beans.xml\");\n        BeanFactory factory = new XmlBeanFactory(resource);\n        MyBean myBean = (MyBean) factory.getBean(\"myBean\");\n        myBean.doSomething();\n    }\n}\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 6. What is the ApplicationContext in Spring?\n\nApplicationContext is an extension of BeanFactory that provides more advanced features. It includes functionalities such as internationalization, event propagation, declarative mechanisms to create a bean, and various ways to look up a bean. It is more feature-rich and is typically used in enterprise applications.\n\n**Example:**\n\n```java\n// XML Configuration (beans.xml)\n\u003cbeans\u003e\n    \u003cbean id=\"myBean\" class=\"com.example.MyBean\"/\u003e\n\u003c/beans\u003e\n\n// Java Code\npublic class MainApp {\n    public static void main(String[] args) {\n        ApplicationContext context = new ClassPathXmlApplicationContext(\"beans.xml\");\n        MyBean myBean = (MyBean) context.getBean(\"myBean\");\n        myBean.doSomething();\n    }\n}\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 7. What is the difference between BeanFactory and ApplicationContext?\n\n| Feature            | BeanFactory                              | ApplicationContext                          |\n|--------------------|------------------------------------------|---------------------------------------------|\n| Initialization     | Lazy initialization                      | Eager initialization                        |\n| Advanced Features  | Limited                                  | Provides advanced features like event propagation, declarative mechanisms, etc. |\n| Internationalization | Not supported                            | Supported                                   |\n| Event Handling     | Not supported                            | Supported                                   |\n| Dependency Injection | Basic                                   | Advanced (supports annotations, AOP, etc.) |\n\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 8. How do you configure a Spring application using XML?\n\n**Example:**\n\n```xml\n\u003c!-- beans.xml --\u003e\n\u003cbeans xmlns=\"http://www.springframework.org/schema/beans\"\n       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n       xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n                           http://www.springframework.org/schema/beans/spring-beans.xsd\"\u003e\n\n    \u003cbean id=\"myBean\" class=\"com.example.MyBean\"\u003e\n        \u003cproperty name=\"property\" value=\"value\"/\u003e\n    \u003c/bean\u003e\n\n\u003c/beans\u003e\n```\n\n```java\n// Java Code\npublic class MainApp {\n    public static void main(String[] args) {\n        ApplicationContext context = new ClassPathXmlApplicationContext(\"beans.xml\");\n        MyBean myBean = (MyBean) context.getBean(\"myBean\");\n        myBean.doSomething();\n    }\n}\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 9. What is a Spring Bean?\n\nA Spring Bean is an object that is instantiated, assembled, and otherwise managed by the Spring IoC (Inversion of Control) container. Beans are the fundamental building blocks of a Spring application.\n\n**Example:**\n\n```java\npublic class MyBean {\n    private String property;\n\n    public void setProperty(String property) {\n        this.property = property;\n    }\n\n    public void doSomething() {\n        System.out.println(\"Property value: \" + property);\n    }\n}\n```\n\n```xml\n\u003c!-- beans.xml --\u003e\n\u003cbeans\u003e\n    \u003cbean id=\"myBean\" class=\"com.example.MyBean\"\u003e\n        \u003cproperty name=\"property\" value=\"value\"/\u003e\n    \u003c/bean\u003e\n\u003c/beans\u003e\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 10. What are the different scopes of Spring Beans?\n\n- **Singleton**: Only one instance of the bean is created for the Spring container. This is the default scope.\n- **Prototype**: A new instance is created each time the bean is requested.\n- **Request**: A new instance is created for each HTTP request. Applicable only in the context of a web-aware Spring ApplicationContext.\n- **Session**: A new instance is created for each HTTP session. Applicable only in the context of a web-aware Spring ApplicationContext.\n- **Global-session**: A single instance is created for the global HTTP session. Applicable only in the context of a web-aware Spring ApplicationContext.\n\n**Example:**\n\n```xml\n\u003c!-- beans.xml --\u003e\n\u003cbeans\u003e\n    \u003cbean id=\"singletonBean\" class=\"com.example.SingletonBean\" scope=\"singleton\"/\u003e\n    \u003cbean id=\"prototypeBean\" class=\"com.example.PrototypeBean\" scope=\"prototype\"/\u003e\n\u003c/beans\u003e\n```\n\n```java\npublic class MainApp {\n    public static void main(String[] args) {\n        ApplicationContext context = new ClassPathXmlApplicationContext(\"beans.xml\");\n\n        // Singleton Scope\n        SingletonBean singletonBean1 = (SingletonBean) context.getBean(\"singletonBean\");\n        SingletonBean singletonBean2 = (SingletonBean) context.getBean(\"singletonBean\");\n        System.out.println(singletonBean1 == singletonBean2); // true\n\n        // Prototype Scope\n        PrototypeBean prototypeBean1 = (PrototypeBean) context.getBean(\"prototypeBean\");\n        PrototypeBean prototypeBean2 = (PrototypeBean) context.getBean(\"prototypeBean\");\n        System.out.println(prototypeBean1 == prototypeBean2); // false\n    }\n}\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 11. How do you define a Spring Bean in XML configuration?\n\nA Spring Bean can be defined in the XML configuration file using the `\u003cbean\u003e` element. The `id` attribute specifies the bean's identifier, and the `class` attribute specifies the fully qualified class name of the bean.\n\n**Example:**\n\n```xml\n\u003c!-- beans.xml --\u003e\n\u003cbeans xmlns=\"http://www.springframework.org/schema/beans\"\n       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n       xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n                           http://www.springframework.org/schema/beans/spring-beans.xsd\"\u003e\n\n    \u003cbean id=\"myBean\" class=\"com.example.MyBean\"\u003e\n        \u003cproperty name=\"property\" value=\"value\"/\u003e\n    \u003c/bean\u003e\n\n\u003c/beans\u003e\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 12. What is the default scope of a Spring Bean?\n\nThe default scope of a Spring Bean is `singleton`. This means that only one instance of the bean is created for the Spring container.\n\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 13. How do you inject a bean using constructor injection?\n\nConstructor injection is performed by defining a constructor in the bean class and specifying the dependencies in the XML configuration.\n\n**Example:**\n\n```java\npublic class MyBean {\n    private final Dependency dependency;\n\n    // Constructor\n    public MyBean(Dependency dependency) {\n        this.dependency = dependency;\n    }\n\n    public void doSomething() {\n        dependency.perform();\n    }\n}\n```\n\n```xml\n\u003c!-- beans.xml --\u003e\n\u003cbeans\u003e\n    \u003cbean id=\"dependency\" class=\"com.example.Dependency\"/\u003e\n    \u003cbean id=\"myBean\" class=\"com.example.MyBean\"\u003e\n        \u003cconstructor-arg ref=\"dependency\"/\u003e\n    \u003c/bean\u003e\n\u003c/beans\u003e\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 14. How do you inject a bean using setter injection?\n\nSetter injection is performed by defining setter methods in the bean class and specifying the dependencies in the XML configuration.\n\n**Example:**\n\n```java\npublic class MyBean {\n    private Dependency dependency;\n\n    // Setter method\n    public void setDependency(Dependency dependency) {\n        this.dependency = dependency;\n    }\n\n    public void doSomething() {\n        dependency.perform();\n    }\n}\n```\n\n```xml\n\u003c!-- beans.xml --\u003e\n\u003cbeans\u003e\n    \u003cbean id=\"dependency\" class=\"com.example.Dependency\"/\u003e\n    \u003cbean id=\"myBean\" class=\"com.example.MyBean\"\u003e\n        \u003cproperty name=\"dependency\" ref=\"dependency\"/\u003e\n    \u003c/bean\u003e\n\u003c/beans\u003e\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 15. What is the role of the @Autowired annotation?\n\nThe `@Autowired` annotation is used for automatic dependency injection in Spring. It can be applied to constructors, setter methods, and fields. Spring will automatically wire the annotated dependency by type.\n\n**Example:**\n\n```java\n@Component\npublic class MyBean {\n    @Autowired\n    private Dependency dependency;\n\n    public void doSomething() {\n        dependency.perform();\n    }\n}\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 16. What is the purpose of the @Component annotation?\n\nThe `@Component` annotation indicates that a class is a Spring component. It is a generic stereotype for any Spring-managed component and allows Spring to automatically detect and register the bean.\n\n**Example:**\n\n```java\n@Component\npublic class MyBean {\n    public void doSomething() {\n        System.out.println(\"Doing something...\");\n    }\n}\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 17. What are Spring stereotypes?\n\nSpring stereotypes are annotations that indicate the role of a Spring-managed component. These annotations help in better organizing and managing the components within a Spring application. Common stereotypes include `@Component`, `@Service`, `@Repository`, and `@Controller`.\n\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 18. How do you enable component scanning in Spring?\n\nComponent scanning is enabled using the `\u003ccontext:component-scan\u003e` element in XML configuration or the `@ComponentScan` annotation in Java configuration.\n\n**Example (XML Configuration):**\n\n```xml\n\u003c!-- beans.xml --\u003e\n\u003cbeans xmlns=\"http://www.springframework.org/schema/beans\"\n       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n       xmlns:context=\"http://www.springframework.org/schema/context\"\n       xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n                           http://www.springframework.org/schema/beans/spring-beans.xsd\n                           http://www.springframework.org/schema/context\n                           http://www.springframework.org/schema/context/spring-context.xsd\"\u003e\n\n    \u003ccontext:component-scan base-package=\"com.example\"/\u003e\n\u003c/beans\u003e\n```\n\n**Example (Java Configuration):**\n\n```java\n@Configuration\n@ComponentScan(basePackages = \"com.example\")\npublic class AppConfig {\n}\n```\n#### **[⬆ Back to Top](#level--spring-core-easy)**\n---\n\n### 19. What is the difference between @Component, @Service, @Repository, and @Controller?\n\n| Annotation    | Description                                       ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbikkimahato%2Fspring-interview-questions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbikkimahato%2Fspring-interview-questions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbikkimahato%2Fspring-interview-questions/lists"}