Skip to content
$ lynuxpro

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 31–45 of 224 questions

31.How do you test code that calls AWS?MidPython for DevOps

Mock the client in unit tests or use moto to fake AWS. Keep real-cloud tests few, slow and separate.

32.What does a --dry-run flag do, and why add it?MidPython for DevOps

It shows what the tool would change without changing anything. People can check the result first, so a mistake costs nothing.

33.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.

34.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.

35.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.

36.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.

37.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.

38.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.

39.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.

40.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.

41.What is Clean as You Code?MidSonarQube & Code Quality

A way to apply the quality gate only to new or changed code. New code must be clean, and old problems are fixed little by little, so the gate stays fair and useful.

42.What is the new code period and what options exist?MidSonarQube & Code Quality

It is the starting point for what counts as new code: since the previous version, a number of days, a reference branch, or a specific analysis you pick.

43.How do you make a pipeline fail when the quality gate fails?MidSonarQube & Code Quality

Set sonar.qualitygate.wait=true so the scanner waits for the result and exits with an error on failure. Also require pipelines to pass before merging.

44.Why set GIT_DEPTH to 0 in GitLab CI for the scan?MidSonarQube & Code Quality

The scanner needs the full Git history to work out new code and blame. A shallow clone gives warnings and wrong results.

45.Who measures code coverage?MidSonarQube & Code Quality

A coverage tool such as JaCoCo, coverage.py or Jest writes a report while tests run. SonarQube reads that report. If it shows 0%, the report path is wrong or tests ran after the scan.