Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Kotlin
Kotlinmedium

`launch` vs `async` — what’s the difference in coroutines?

Tags
#coroutines#async#launch#deferred
Back to categoryPractice quiz

Answer

`launch` starts a coroutine for side-effects and returns a `Job`. `async` returns a `Deferred<T>` for a result and you `await()` it; both should run inside a scope (structured concurrency).

coroutineScope {
  val a = async { 1 }
  val b = async { 2 }
  val sum = a.await() + b.await()
  println(sum)
}

Related questions

Kotlin
coroutineScope vs supervisorScope: how do they handle failures?
#kotlin#coroutines#supervisor
Kotlin
StateFlow vs SharedFlow: what’s the difference?
#kotlin#stateflow#sharedflow
Kotlin
Coroutine exceptions: how do they propagate and when to use `CoroutineExceptionHandler`?
#kotlin#coroutines#exceptions
Kotlin
Dispatchers in Kotlin coroutines: `Default` vs `IO` vs `Main`?
#kotlin#coroutines#dispatchers
Kotlin
Channel vs Flow - how are they different in coroutines?
#kotlin#coroutines#flow
Kotlin
Coroutine cancellation is cooperative — what does that mean in practice?
#coroutines#cancellation#isActive