All MicroEvals
android test
Create MicroEval
Header image for android test

android test

Prompt

Act as a Senior Android Engineer and Mobile Architect. Your task is to solve the following Android production scenario. Requirements: - Kotlin only - Jetpack Compose only (Material 3) - MVVM or MVI with UDF - Coroutines + Flow - Hilt DI - Room - Retrofit - Navigation Compose - KSP instead of KAPT - Android best practices for 2026 Scenario: You are building a Game Tracker Android application. Users can: - Search games - Apply filters (genre, platform, year, rating) - Sort results - Add games to their library - Change game status (Wishlist, Playing, Completed, Dropped) - View game details - Work offline Technical requirements: 1. Search must support: - Debounce - Cancel previous requests when query changes - Preserve state across configuration changes - Restore state after process death 2. Filters: - Multiple genres - Multiple platforms - Year range - Rating range - Sort type 3. Offline-first: - Cached results shown immediately - Network updates database - UI automatically reacts to DB changes 4. Pagination: - Infinite scrolling - Pull-to-refresh - Error recovery 5. Performance: - Minimize unnecessary recompositions - Avoid duplicated state - Avoid race conditions Tasks: A. Design the architecture. Explain: - Layers - Data flow - State management - Source of truth - Error handling B. Design the data layer. Provide: - Retrofit API interfaces - DTOs - Mappers - Room entities - DAOs - Repository implementation C. Design the presentation layer. Provide: - UI State - UI Events - UI Actions - ViewModel - Compose screen D. Explain how: - Process death is handled - Configuration changes are handled - Coroutines are cancelled correctly - Search debounce works - Pagination works - Offline mode works E. Identify: - Potential memory leaks - Potential race conditions - Potential ANRs - Potential recomposition issues F. Testing. Provide: - Unit tests - Flow tests with Turbine - ViewModel tests - Compose UI tests G. Interview section. Explain: - Why StateFlow instead of LiveData - Why Room is the source of truth - Why Repository exists - Why not expose MutableStateFlow - Why collectAsStateWithLifecycle is important Do not provide simplified examples. Provide production-ready code and explain trade-offs. Critique your own solution and mention alternative approaches.

Drag to resize
Drag to resize
Drag to resize