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 106–120 of 570 questions

106.What is a quality gate?BeginnerSonarQube & Code Quality

A pass or fail rule made of conditions, such as no new bugs and at least 80% coverage on new code. If a condition fails, the gate fails and the pipeline can stop.

107.What is the difference between a bug, a vulnerability and a code smell?BeginnerSonarQube & Code Quality

A bug is code that will probably behave wrongly. A vulnerability is code an attacker could abuse. A code smell works but is hard to read or change.

108.What does the scanner do, and what does the server do?BeginnerSonarQube & Code Quality

The scanner reads your code and sends a report. The server stores the results, applies the rules and decides if the quality gate passes.

109.Why does SonarQube need a database like PostgreSQL?BeginnerSonarQube & Code Quality

It stores every analysis, issue and setting. The built-in test database is only for evaluation and cannot be upgraded.

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

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

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

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

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

115.What is the difference between a quality profile and a quality gate?MidSonarQube & Code Quality

A profile is the list of rules to check for a language and it creates issues. A gate is the pass or fail judgment on the resulting numbers.

116.Why extend Sonar way instead of copying it?MidSonarQube & Code Quality

An extended profile inherits from its parent, so new rules added to Sonar way arrive automatically. A copy goes stale.

117.What is a security hotspot?MidSonarQube & Code Quality

Sensitive code that needs a person to decide if it is safe, such as a weak hash. The reviewer marks it Safe, Acknowledged or Fixed. The gate usually requires all new hotspots to be reviewed.

118.What is SonarQube for IDE (SonarLint) and why use connected mode?MidSonarQube & Code Quality

It is an editor plugin that shows issues as you type. Connected mode uses your server's quality profile and decisions, so the IDE and the server agree.

119.Which features need a paid edition?SeniorSonarQube & Code Quality

Branch analysis and merge request decoration need Developer edition or above, and portfolios and reports need Enterprise. Features can move between editions, so check the current comparison.

120.How do you run SonarQube in production on Kubernetes?SeniorSonarQube & Code Quality

Use the official Helm chart, an external managed PostgreSQL, persistent volumes, an Ingress with HTTPS and enough memory. Run one instance in standard editions, because only Data Center supports clustering.