Kotlin Coroutines and Flow
Asynchronous programming with Coroutines: launch, async, suspend functions, Dispatchers, Flow, StateFlow, SharedFlow
1What is a coroutine in Kotlin?
What is a coroutine in Kotlin?
Câu trả lời
A coroutine is a lightweight thread that allows writing asynchronous code sequentially. It can be suspended without blocking the thread, allowing other tasks to execute. More efficient than traditional threads.
2What is the difference between launch and async?
What is the difference between launch and async?
Câu trả lời
launch starts a coroutine that doesn't return a result (returns a Job). async starts a coroutine that returns a result via a Deferred (await()). Use async when you need the result.
3What is the suspend keyword used for?
What is the suspend keyword used for?
Câu trả lời
suspend marks a function that can be suspended and resumed later without blocking the thread. These functions can only be called from other suspend functions or coroutines. They enable asynchronous operations.
What is a Dispatcher in coroutines?
When to use Dispatchers.IO?
+17 câu hỏi phỏng vấn
Các chủ đề phỏng vấn Android khác
Android Fundamentals
Android UI and Resources
Android Lifecycle
Android Navigation
Android Data Management
Android Networking
Android Testing
Android Gradle
Kotlin Language Essentials for Android
Room Database
Background Work
Jetpack Compose
Permissions and Device Features
Firebase for Android
Android MVVM Architecture
Advanced Android Networking
Kotlin Collections and Operators
Android Dependency Injection
Android MVI Architecture
Android Clean Architecture
Android Compose Advanced
Android Performance and Monitoring
Android Security and Privacy
Android CI/CD and Release
Android UX and Form Factors
Android Testing Advanced
Nắm vững Android cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí