Kotlin Mastery
Open main menu
Home
About
Daily Quiz
Login
Loading...
Coroutine
1
Can you name some coroutine scope builders?
2
Can you name some Coroutine builders?
3
How do you switch Threads when you are inside a coroutine?
4
Can you name some Coroutine Dispatchers?
5
How can you avoid race conditions happening when multiple Coroutines write to the same property?
6
You are reviewing a class and notice that all but one method are suspend functions. The single non-suspend method is accepting a callback to handle its asynchronous operation. What would you do?
7
How do you wait for a coroutine to complete?
8
How do you cancel a coroutine?
9
What are differences between launch & async?
10
Say you are running an asynchronous function using coroutines. How do you show its progress to the user?
11
How do you test a method that uses coroutine and a private dispatcher of its class. Assume you are unable to inject the Dispatcher.
12
How do you test a function that uses view model scope?
13
Say you have a method that uses a coroutine which has multiple child coroutines? How do you wait all of them to finish? How would you avoid an exception happening inside a child coroutine causing a crash?
14
Can you explain in which order the logs will be printed?
15
What happens when a Coroutine Scope is cancelled?
16
Can you explain what are GlobalScope, ViewModelScope and LifeCycle Scope?