INTERVIEW PREP
Interview questions
570 questions from real DevOps, SRE, platform engineering and MLOps interviews, with the answer an interviewer wants to hear. Try answering out loud first, then open the model answer.
Showing 91–105 of 570 questions
91.Two libraries need different versions of the same dependency. What does Maven do?MidMaven & Build Tools
Nearest definition wins in the dependency tree; at equal depth, the first declared wins. Use mvn dependency:tree -Dverbose to see conflicts and pin the version in dependencyManagement.
92.What is a SNAPSHOT version?MidMaven & Build Tools
A version still in development, like 1.2.0-SNAPSHOT. Repositories store timestamped builds and Maven checks for newer ones. Releases must never depend on snapshots.
93.How do you speed up Maven builds in CI?MidMaven & Build Tools
Cache ~/.m2, use a repository manager mirror, build in parallel with -T, build only changed modules with -pl/-am, skip unneeded plugins, and consider the build cache extension or mvnd.
94.What is dependencyManagement used for?MidMaven & Build Tools
It fixes versions of dependencies in one place (often a parent POM or a BOM) without adding them to every module. Modules then declare the dependency without a version and get the managed one.
95.How do you see why a dependency is on the classpath?MidMaven & Build Tools
mvn dependency:tree shows the full tree, and -Dincludes=group:artifact filters it. Use <exclusions> or dependencyManagement to fix unwanted versions.
96.What is a multi-module project, and why use one?MidMaven & Build Tools
A parent POM lists modules that build together in the right order (the reactor). It shares versions and plugins and lets you build only what changed with -pl module -am.
97.What are Maven profiles?MidMaven & Build Tools
Named sets of settings switched on with -P name, a property, the OS or a missing file. Use them sparingly, for example for a release or integration-test build, so builds stay predictable.
98.What is the difference between the Surefire and Failsafe plugins?MidMaven & Build Tools
Surefire runs unit tests in the test phase and fails the build right away. Failsafe runs integration tests in integration-test and checks results in verify, so cleanup in post-integration-test still runs.
99.How do you make builds reproducible?SeniorMaven & Build Tools
Pin all plugin versions, set project.build.outputTimestamp, use the Maven Wrapper for the Maven version, enforce Java and Maven versions with the enforcer plugin, and verify with artifact:compare.
100.How do you stop builds from pulling dependencies straight from the internet?SeniorMaven & Build Tools
Point Maven at an internal repository manager (Artifactory or Nexus) using a mirror in settings.xml. It caches and controls what comes in, can block vulnerable or unapproved packages, and keeps builds working if public repos go down.
101.How do you release a Maven project in CI?SeniorMaven & Build Tools
Set the release version, build, tag, deploy to the release repository, then bump to the next SNAPSHOT. Many teams use CI-friendly ${revision} versions or the release plugin, and never redeploy the same release version.
102.How do you enforce rules across many Maven projects?SeniorMaven & Build Tools
Use a shared parent POM with the Enforcer plugin (Java version, banned dependencies, dependency convergence), managed plugin versions and BOMs. Add dependency-check or SCA scanning in CI.
103.Maven or Gradle: what are the trade-offs?SeniorMaven & Build Tools
Maven is declarative, very standard and predictable, which suits big enterprises. Gradle is faster with incremental builds and caching and is flexible through a Kotlin or Groovy DSL, but builds can become complex scripts. Pick one per organization and standardize.
104.How do you speed up a slow multi-module build?SeniorMaven & Build Tools
Run modules in parallel (-T 1C), build only changed modules (-pl -am), cache ~/.m2 in CI, use the Maven build cache extension or mvnd, and move slow integration tests to a separate stage.
105.What is static analysis?BeginnerSonarQube & Code Quality
It reads source code and finds known problem patterns without running the program. It is fast and safe, and works next to tests and code review.