Preparing for a DevOps interview that covers SonarQube? These questions come up again and again - here are strong, concrete answers.
Q: What is SonarQube and why use it?
SonarQube statically analyzes code for bugs, vulnerabilities, security hotspots and 'code smells', and enforces a Quality Gate in CI so problematic changes fail the build.
- Catches bugs and vulnerabilities before review
- Quality Gates enforce a consistent bar across teams
- Tracks tech-debt and coverage trends over time
Q: What are the best practices you follow?
- Enforce a 'new code' Quality Gate on every PR
- Wire coverage reports into the scan
- Triage security hotspots, don't blanket-ignore them
Q: What mistakes have you seen?
- Analyzing but not enforcing the Quality Gate, so nothing improves
- Chasing a green gate by disabling rules instead of fixing issues
- No coverage report wired in, so coverage looks like zero
Q: Show a basic configuration
Project configuration file.
# sonar-project.properties
sonar.projectKey=acme-web
sonar.sources=src
sonar.tests=test
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.qualitygate.wait=trueWant senior help putting SonarQube to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.