# Async & Scheduling (Spring Boot) > Asynchrone Ausführung mit @Async, Scheduling mit @Scheduled, ThreadPoolTaskExecutor, Zeitverwaltung - 25 Interview-Fragen - Mid-Level - [Interview-Fragen: Spring Boot](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen.md) ## 1. Welche Annotation macht eine Methode in Spring asynchron? **Antwort** @Async markiert eine Methode für die asynchrone Ausführung. Spring führt diese Methode in einem separaten Thread über einen TaskExecutor aus. Erfordert @EnableAsync auf einer Konfigurationsklasse, um den Mechanismus zu aktivieren. Nützlich für lange Operationen (E-Mail-Versand, Dateiverarbeitung), ohne den Haupt-Thread zu blockieren. Die Methode kann void, Future oder CompletableFuture zurückgeben. ## 2. Welche Annotation aktiviert die Unterstützung für @Async-Methoden in Spring? **Antwort** @EnableAsync aktiviert die Verarbeitung von @Async-Annotationen. Sie muss auf einer @Configuration-Klasse platziert werden. Ohne diese Annotation wird @Async ignoriert und Methoden werden synchron ausgeführt. ## 3. Welcher Legacy-Rückgabetyp ermöglicht das Abrufen des Ergebnisses einer @Async-Methode? **Antwort** Future ist der historische Rückgabetyp für asynchrone Methoden. Ermöglicht das Abrufen des Ergebnisses über future.get() (blockierend). CompletableFuture wird heute wegen seiner funktionalen Programmierung und besseren Komposition bevorzugt. ## 22 weitere Fragen verfügbar - Was ist der Hauptvorteil von CompletableFuture gegenüber Future für @Async-Methoden? - Wofür wird AsyncResult in Spring verwendet? Kostenlos registrieren: https://sharpskill.dev/de/login ## Weitere Spring Boot-Interviewthemen - [Spring Core - IoC & DI](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-core-ioc-di.md): 22 Fragen, Junior - [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 - [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/async-scheduling