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 1–8 of 8 questions
Learn Maven & Build Tools →1.Two libraries need different versions of the same dependency. What does Maven do?Mid
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.
2.What is a SNAPSHOT version?Mid
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.
3.How do you speed up Maven builds in CI?Mid
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.
4.What is dependencyManagement used for?Mid
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.
5.How do you see why a dependency is on the classpath?Mid
mvn dependency:tree shows the full tree, and -Dincludes=group:artifact filters it. Use <exclusions> or dependencyManagement to fix unwanted versions.
6.What is a multi-module project, and why use one?Mid
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.
7.What are Maven profiles?Mid
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.
8.What is the difference between the Surefire and Failsafe plugins?Mid
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.