Scrivio Interview library

Code quality and static analysis

16 questions in 5 subtopics.

SonarQube

ConceptFoundations6 min read
What is a SonarQube quality gate, and why do many teams apply it only to new code?
ScenarioIntermediate6 min read
Developers complain that SonarQube blocks merges with low-value findings and they now mark many issues as 'won't fix'. How would you make the tool useful again?
LeadershipAdvanced6 min read
Should your organisation enforce a single SonarQube quality profile across all teams? Argue both sides and give your decision rule.
LeadershipPrincipal6 min read
Your company has run SonarQube for eight years and the quality gate is now seen as bureaucracy. How do you decide whether to keep, change or replace your static analysis setup?

SpotBugs, PMD, Checkstyle

ConceptFoundations7 min read
What is the difference between SpotBugs, PMD and Checkstyle? Which would catch a possible NullPointerException, an unused private field, and wrong indentation?
DesignIntermediate7 min read
You join a team with a 10-year-old codebase producing 40,000 static analysis warnings. How do you introduce SpotBugs and PMD without stopping delivery?
ScenarioPrincipal6 min read
A CTO asks whether static analysis tooling is worth its cost across the company. How would you evaluate and answer?

Error Prone

ConceptFoundations6 min read
What is Error Prone and how does it differ from tools like SpotBugs?
ScenarioIntermediate7 min read
You want to add Error Prone to a large Maven or Gradle build. What setup and rollout issues should you expect?

Null safety annotations

ConceptFoundations6 min read
What are JSpecify annotations and why did Spring Framework 7 adopt them?
CodingIntermediate6 min read
Given a package annotated @NullMarked, which of these lines would a nullness checker such as NullAway flag, and why?
String name(User u) {
return u.nickname().trim();
}
where nickname() is declared as '@Nullable String nickname()'.
LeadershipAdvanced6 min read
Should your organisation adopt null-safety checking (JSpecify plus NullAway or similar) across all Java services? How would you roll it out?

ArchUnit

CodingFoundations5 min read
Write an ArchUnit rule that fails if any class in the ..web.. package accesses a class in the ..repository.. package directly.
DesignIntermediate7 min read
A team wants to enforce module boundaries inside a Spring Boot monolith. Compare ArchUnit, Java modules (JPMS) and Spring Modulith for this goal.
DesignAdvanced7 min read
You want the same architecture rules (no web-to-repository access, no cycles between modules, no use of deprecated internal APIs) in 80 services. How would you package and roll out ArchUnit rules across teams?
LeadershipPrincipal6 min read
Over a long-lived codebase, architecture tends to erode. What role should automated architecture tests play compared with design reviews and team structure?