Kotlin Coroutinesとflow
Coroutinesを使った非同期プログラミング:launch、async、suspend functions、Dispatchers、Flow、StateFlow、SharedFlow
20 面接問題·
Mid-Level
1Kotlinにおけるcoroutineとは何ですか?
1
Kotlinにおけるcoroutineとは何ですか?
回答
coroutineは軽量なthreadで、非同期コードを逐次的に記述できます。threadをブロックせずにsuspendでき、他のタスクを実行できます。従来のthreadより効率的です。
2launchとasyncの違いは何ですか?
2
launchとasyncの違いは何ですか?
回答
launchは結果を返さないcoroutineを開始します(Jobを返す)。asyncはDeferred(await())を介して結果を返すcoroutineを開始します。結果が必要な場合はasyncを使用します。
3suspendキーワードは何のために使いますか?
3
suspendキーワードは何のために使いますか?
回答
suspendはthreadをブロックせずにsuspendして後で再開できる関数をマークします。これらの関数は他のsuspend functionsまたはcoroutinesからのみ呼び出せます。非同期処理を可能にします。
4
coroutinesにおけるDispatcherとは何ですか?
5
Dispatchers.IOはいつ使いますか?
+17 面接問題
その他のAndroid面接トピック
Android の基礎
Junior
24問Android UIとリソース
Junior
30問Androidライフサイクル
Junior
30問Android ナビゲーション
Junior
26問Android データ管理
Junior
29問Android ネットワーキング
Junior
29問Android テスト
Junior
28問Android Gradle
Junior
26問Android向けKotlin言語の基礎
Junior
24問Room Database
Mid-Level
25問バックグラウンド処理
Mid-Level
18問Jetpack Compose
Mid-Level
28問パーミッションとデバイス機能
Mid-Level
21問Android向けFirebase
Mid-Level
23問Android MVVM Architecture
Mid-Level
18問Androidネットワーキング上級
Mid-Level
13問Kotlinのコレクションと演算子
Mid-Level
20問Android の依存性注入
Mid-Level
15問Android MVI Architecture
Mid-Level
17問Android Clean Architecture
Senior
21問Android Compose 上級
Senior
17問Android Performance and Monitoring
Senior
13問Android Security and Privacy
Senior
18問Android CI/CD and Release
Senior
15問Android UX and Form Factors
Senior
18問Android Testing Advanced
Senior
18問