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 1–9 of 9 questions

Learn SonarQube & Code Quality →
1.What is Clean as You Code?Mid

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.

2.What is the new code period and what options exist?Mid

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.

3.How do you make a pipeline fail when the quality gate fails?Mid

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.

4.Why set GIT_DEPTH to 0 in GitLab CI for the scan?Mid

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

5.Who measures code coverage?Mid

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.

6.What is the difference between a quality profile and a quality gate?Mid

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.

7.Why extend Sonar way instead of copying it?Mid

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

8.What is a security hotspot?Mid

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.

9.What is SonarQube for IDE (SonarLint) and why use connected mode?Mid

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.