Skip to main content
David Cruz Anaya

David Cruz Anaya

Senior Android & Kotlin Multiplatform Engineer

  • Home
  • About
  • Portfolio
  • Book
  • Speaking
  • Blog
  • Flashcards
  • Nomad Life
  • Contact
Visit Vectencia Shop

Follow Me

Privacy Policy

2014 - 2026 © davthecoder is trading as Vectencia Ltd.

davthecoder
davthecoder.com
davthecoder × Vectencia
⚡

Coroutine Deep Cuts

Find the bugs in each code snippet

Parallel Data Loader1 P03 total
1/7
1class DashboardViewModel(
2 private val hotelRepo: HotelRepository,
3 private val bookingRepo: BookingRepository,
4 private val reviewRepo: ReviewRepository
5) : ViewModel() {
6
7 val uiState = MutableStateFlow(DashboardState())
8
9 fun loadDashboard() {
10 viewModelScope.launch(SupervisorJob()) {
11 val hotels = async { hotelRepo.getFeatured() }
12 val bookings = async { bookingRepo.getUpcoming() }
13 val reviews = async { reviewRepo.getRecent() }
14
15 uiState.update {
16 it.copy(
17 hotels = hotels.await(),
18 bookings = bookings.await(),
19 reviews = reviews.await(),
20 isLoading = false
21 )
22 }
23 }
24 }
25}
Click on the lines you think have bugsFound 0 of 3
←→NavigateAShow remainingRReset
🎯Bug Formula: What's wrong → What breaks for the user → The fix → The trade-off
Skip to main content
David Cruz Anaya

David Cruz Anaya

Senior Android & Kotlin Multiplatform Engineer

  • Home
  • About
  • Portfolio
  • Book
  • Speaking
  • Blog
  • Flashcards
  • Nomad Life
  • Contact
Visit Vectencia Shop

Follow Me

Privacy Policy

2014 - 2026 © davthecoder is trading as Vectencia Ltd.

davthecoder
davthecoder.com
davthecoder × Vectencia
⚡

Coroutine Deep Cuts

Find the bugs in each code snippet

Parallel Data Loader1 P03 total
1/7
1class DashboardViewModel(
2 private val hotelRepo: HotelRepository,
3 private val bookingRepo: BookingRepository,
4 private val reviewRepo: ReviewRepository
5) : ViewModel() {
6
7 val uiState = MutableStateFlow(DashboardState())
8
9 fun loadDashboard() {
10 viewModelScope.launch(SupervisorJob()) {
11 val hotels = async { hotelRepo.getFeatured() }
12 val bookings = async { bookingRepo.getUpcoming() }
13 val reviews = async { reviewRepo.getRecent() }
14
15 uiState.update {
16 it.copy(
17 hotels = hotels.await(),
18 bookings = bookings.await(),
19 reviews = reviews.await(),
20 isLoading = false
21 )
22 }
23 }
24 }
25}
Click on the lines you think have bugsFound 0 of 3
←→NavigateAShow remainingRReset
🎯Bug Formula: What's wrong → What breaks for the user → The fix → The trade-off