# Spring Core - IoC & DI (Spring Boot) > Inversion of Control, Dependency Injection, Annotationen (@Component, @Autowired, @Bean), Scopes, Bean-Lebenszyklus - 22 Interview-Fragen - Junior - [Interview-Fragen: Spring Boot](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen.md) ## 1. Was ist Inversion of Control (IoC) in Spring? **Antwort** IoC ist ein Prinzip, bei dem das Spring-Framework die Objekterstellung und den Lebenszyklus verwaltet, anstatt des Entwicklers. Dies kehrt den traditionellen Kontrollfluss um, bei dem der Anwendungscode seine Abhängigkeiten direkt instanziiert. Spring verwendet einen IoC-Container, um Beans und ihre Abhängigkeiten deklarativ zu verwalten. ## 2. Was ist ein Bean in Spring? **Antwort** Ein Bean ist ein Objekt, das vom Spring-IoC-Container verwaltet wird. Es wird von Spring gemäß den Konfigurationsmetadaten (Annotations, XML oder Java Config) instanziiert, konfiguriert und zusammengesetzt. Beans sind der Kern einer Spring-Anwendung und profitieren von der Dependency Injection. ## 3. Was ist der Zweck der @Component-Annotation? **Antwort** Die @Component-Annotation kennzeichnet eine Klasse als Spring-Bean, der während des durch @ComponentScan aktivierten Component-Scannings automatisch erkannt wird. Spring erstellt eine Instanz dieser Klasse und legt sie mit einem Standardnamen (Klasse in camelCase) im IoC-Container ab. Es ist die generische Stereotype-Annotation, von der @Service, @Repository und @Controller abgeleitet werden, um eine spezifische Geschäftssemantik einzubringen. ## 19 weitere Fragen verfügbar - Was sind die drei Arten der Dependency Injection in Spring? - Wie funktioniert die @Autowired-Annotation? Kostenlos registrieren: https://sharpskill.dev/de/login ## Weitere Spring Boot-Interviewthemen - [Spring Boot Auto-Configuration](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-auto-configuration.md): 20 Fragen, Junior - [Spring Boot Starters](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-starters.md): 18 Fragen, Junior - [Application Properties & YAML](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/application-properties-yml.md): 16 Fragen, Junior - [Logging mit SLF4J und Logback](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/logging.md): 20 Fragen, Junior - [Spring Boot DevTools](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-devtools.md): 15 Fragen, Junior - [Spring MVC Basics](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-mvc-basics.md): 20 Fragen, Mid-Level - [Spring REST Controllers](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-rest-controllers.md): 20 Fragen, Mid-Level - [Request & Response Handling](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/request-response-handling.md): 20 Fragen, Mid-Level - [Ausnahmebehandlung](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/exception-handling.md): 25 Fragen, Mid-Level - [Bean Validation](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/bean-validation.md): 25 Fragen, Mid-Level - [Spring Data JPA Grundlagen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-data-jpa-basics.md): 25 Fragen, Mid-Level - [JPA-Entitäten und Beziehungen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/jpa-entities-relationships.md): 30 Fragen, Mid-Level - [JPA-Abfragen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/jpa-queries.md): 30 Fragen, Mid-Level - [Spring Data Repositories](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-data-repositories.md): 25 Fragen, Mid-Level - [Spring Security Grundlagen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-security-basics.md): 25 Fragen, Mid-Level - [Spring Boot Actuator](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-actuator.md): 20 Fragen, Mid-Level - [Unit-Tests mit JUnit & Mockito](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/testing-junit-mockito.md): 30 Fragen, Mid-Level - [Spring Boot Testing](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-testing.md): 30 Fragen, Mid-Level - [Profiles und Environment](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/profiles-environment.md): 20 Fragen, Mid-Level - [RestTemplate und WebClient](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/resttemplate-webclient.md): 24 Fragen, Mid-Level - [Async & Scheduling](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/async-scheduling.md): 25 Fragen, Mid-Level - [Caching mit Spring](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/caching.md): 25 Fragen, Mid-Level - [Spring WebFlux (Reactive)](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-webflux.md): 25 Fragen, Mid-Level - [Spring-Transaktionen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/transactions.md): 30 Fragen, Senior - [Erweiterte Authentifizierung und Autorisierung](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/authentication-authorization.md): 30 Fragen, Senior - [JWT & Stateless-Sicherheit](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/jwt-stateless-security.md): 20 Fragen, Senior - [OAuth2 & Authorization Server](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/oauth2-authorization-server.md): 20 Fragen, Senior - [Spring Boot und Docker](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-docker.md): 19 Fragen, Senior - [Microservices mit Spring](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/microservices-basics.md): 25 Fragen, Senior - [Spring Cloud Config](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-cloud-config.md): 19 Fragen, Senior - [Performance-Optimierung](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/performance-optimization.md): 30 Fragen, Senior - [GraalVM Native Images](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/graalvm-native-images.md): 20 Fragen, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-core-ioc-di