InterviewStack.io LogoInterviewStack.io

Code Quality and Review Questions

Evaluating code for correctness, clarity, maintainability, performance, and security and providing actionable feedback. Candidates should be able to identify bugs, logical errors, anti patterns, and algorithmic inefficiencies, and to suggest concrete fixes or refactorings. Reviews should cover naming, modularity, documentation, testability, and design patterns, and recommend appropriate unit and integration tests. Candidates should also diagnose performance issues, reason about trade offs when optimizing, and consider how changes affect reliability and security.

EasyBehavioral
70 practiced
Behavioral: Tell me about a time when you found a critical bug or security issue in infrastructure code during a code review. Use the STAR format: describe the Situation, the Task you had, the Actions you took as reviewer and with the team, and the Results (including any follow-up changes to process or automation).
EasyTechnical
82 practiced
You open a PR that contains 25 files with mixed issues: a bug in a provisioning script, a security misconfiguration in Terraform, and many minor style issues. As the reviewer, explain how you would triage and classify comments into 'must-fix before merge', 'should-fix before merge', and 'optional', and give two example comments for each category with justification.
EasyTechnical
98 practiced
As a systems engineer reviewing infrastructure code (Terraform, Ansible, Bash, Python), create a practical code-review checklist you would apply to pull requests. The checklist should cover correctness, clarity, maintainability, performance, security, testability, operational readiness (observability, rollback), documentation, and dependency/secret handling. For each checklist item include a 1-2 sentence rationale and a concrete example of what to look for in PR diffs or code.
MediumSystem Design
99 practiced
Design a code-review checklist specifically for Terraform modules in a large, multi-team organization. The checklist should cover module interface design (inputs/outputs), naming/tags, use of locals, avoidance of provider-specific hardcoding, state backend considerations, reuse, documentation/examples, and security controls. Provide the checklist and explain why each item matters at organizational scale.
MediumTechnical
68 practiced
You are reviewing an Ansible playbook intended to be idempotent. Identify problems in this snippet and propose changes to make it idempotent and testable.
yaml
- hosts: web
  tasks:
    - name: install nginx
      command: apt-get install -y nginx
    - name: create conf
      copy:
        content: "server { listen 80; }"
        dest: /etc/nginx/sites-enabled/default
    - name: restart nginx
      service:
        name: nginx
        state: restarted
What would you change and why? How would you test the playbook in CI?

Unlock Full Question Bank

Get access to hundreds of Code Quality and Review interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.