0
0
Android Kotlinmobile~20 mins

App size optimization in Android Kotlin - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
App Size Optimization Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding App Size Reduction Techniques

Which of the following techniques directly reduces the APK size by removing unused code and resources?

AUsing ProGuard or R8 to shrink and obfuscate the code
BIncreasing the minSdkVersion to support fewer devices
CAdding more drawable resources for different screen density
DUsing multiDex to split the app into multiple dex files
Attempts:
2 left
💡 Hint

Think about tools that remove unused parts of your code and resources.

ui_behavior
intermediate
2:00remaining
Effect of Using Vector Drawables

You replace all PNG images with vector drawables in your Android app. What is the most likely effect on the app size and UI?

AApp size stays the same but images lose quality on large screens
BApp size increases because vector drawables are larger than PNGs
CApp size decreases and images scale smoothly on all screen sizes
DApp crashes because vector drawables are not supported on any Android version
Attempts:
2 left
💡 Hint

Think about how vector images work compared to bitmaps.

lifecycle
advanced
2:00remaining
Impact of Resource Qualifiers on APK Size

Your app includes multiple resource folders for different screen densities (mdpi, hdpi, xhdpi, xxhdpi). What happens to the APK size and resource loading when you build a universal APK?

AAPK size increases but device loads all density resources at runtime
BAPK size decreases because only the device's density resources are included automatically
CAPK size stays the same but app crashes if device density resource is missing
DAPK size increases because all density resources are included; device loads only matching density at runtime
Attempts:
2 left
💡 Hint

Consider what happens when you bundle resources for all devices in one APK.

navigation
advanced
2:00remaining
Using Dynamic Feature Modules to Optimize App Size

You want to reduce initial download size by delivering some features only when needed. Which Android feature allows this behavior?

AMultiDex to split code into multiple dex files
BDynamic Feature Modules with Play Feature Delivery
CUsing ProGuard to shrink code
DAdding all features in the base APK for faster access
Attempts:
2 left
💡 Hint

Think about modularizing features and downloading them on demand.

📝 Syntax
expert
2:00remaining
Analyzing Kotlin Code for Unused Resource Removal

Given this Kotlin snippet in an Android app, what is the value of unusedResourcesCount after running?

val resources = listOf("icon.png", "background.jpg", "unused.png")
val usedResources = listOf("icon.png", "background.jpg")
val unusedResourcesCount = resources.count { it !in usedResources }
A1
B2
C0
DThrows a runtime exception
Attempts:
2 left
💡 Hint

Count how many items in resources are not in usedResources.