Build Variants & Signing Interview Questions

BUILD & TOOLING › Gradle

What are build types and product flavours, and how do they combine into build variants?

What a strong answer covers: Build types describe how the app is built, typically debug (debuggable, unminified) and release (minified, signed). Product flavours describe versions of the app, like free and paid or dev, staging and prod, grouped by flavour dimensions. Each combination is a build variant (prodRelease, devDebug), with its own source sets, resources and dependencies.

How do you manage different API URLs or keys for different environments?

What a strong answer covers: Use buildConfigField per flavour or build type (enabled with buildFeatures.buildConfig), resValue for resources, or flavour-specific source sets with different config classes. Keep secrets out of version control: read them from local.properties, environment variables or CI secrets, ideally with the Secrets Gradle Plugin, and remember anything in the APK can be extracted.

How does app signing work, and what is Play App Signing?

What a strong answer covers: Every APK is signed; updates must be signed with the same key. With Play App Signing, Google holds the app signing key and you sign uploads with an upload key, which can be reset if lost or leaked. Debug builds use an automatic debug key. Signing configs for release should come from secure CI secrets, not committed files.

What's the difference between an APK and an Android App Bundle?

What a strong answer covers: An APK is the installable package. An AAB is a publishing format uploaded to Play, which generates optimised split APKs per device configuration (ABI, screen density, language), so users download less. AABs are required for new Play apps and enable Play Feature Delivery for on-demand modules.

Flavours multiply quickly. How would you structure a project with several white-label brands and environments without the build getting out of hand?

What a strong answer covers: Use flavour dimensions sparingly (brand x environment), filter out unused variants with androidComponents beforeVariants, keep brand differences in resources and a config object rather than diverging code, share code through modules, and generate configuration from data files. Consider whether environment should be a runtime setting in internal builds instead of a flavour. CI builds only the variants it needs.

Back to Build Variants & Signing