Gradle is the standard build system for Kotlin JVM, Android, and KMP projects—like Maven for Java but with Kotlin DSL (build.gradle.kts) and rich plugin ecosystems.
Typical layout
settings.gradle.kts— project name and included modulesbuild.gradle.kts— plugins, dependencies, Kotlin JVM targetsrc/main/kotlin— production sources;src/test/kotlin— tests
Common tasks
./gradlew build, test, run (with application plugin). Pin Kotlin and AGP versions in team projects; use version catalogs for large repos.
Important interview questions and answers
- Q: Gradle vs Maven?
A: Both resolve dependencies; Gradle offers flexible Kotlin DSL and incremental builds—default for Android. - Q: What is the wrapper?
A:gradlewscripts pin Gradle version so CI and developers share the same build tool.
Self-check
- Where do main Kotlin sources live in a JVM app?
- What file declares included modules?
Tip: Commit the Gradle Wrapper (gradlew) so CI and teammates use the same Gradle version.
Interview prep
- build.gradle.kts?
Kotlin DSL for Gradle build scripts.
- Wrapper purpose?
Reproducible Gradle version via gradlew.