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.
MediumTechnical
99 practiced
Technical coding: Given the following Python function used in a deployment script, write pytest unit tests that cover normal behavior and edge cases. Mock external API calls.Provide at least three tests and explain why you chose them.
python
import requests
def get_latest_image(repo):
r = requests.get(f'https://registry.example/api/{repo}/latest')
r.raise_for_status()
return r.json()['tag']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.
HardTechnical
77 practiced
You are reviewing a Helm chart for a critical service and notice templates that duplicate labels, interpolate values unsafely, and use `imagePullPolicy: Always` with `latest` tags. The Chart.yaml and templates are large. What templating anti-patterns would you flag, and how would you refactor the chart to be safer, testable, and reusable? Include unit-test strategies for Helm charts.
EasyTechnical
92 practiced
A colleague submitted a small Python utility that parses syslog files and prints a summary. The snippet:Identify code smells, maintainability and correctness problems, and suggest a refactor that improves clarity, testability, and robustness.
python
def parse(lines):
counts = {}
for l in lines:
level = l.split()[2]
counts.setdefault(level, 0)
counts[level] += 1
print(counts)HardSystem Design
83 practiced
System design: A large organization has 100+ Terraform modules and many teams. Design an automated code-review pipeline that enforces policy, runs security checks, validates plans, and scales with many contributors. Include component responsibilities (pre-commit, CI hooks, policy-as-code), performance considerations, and how to handle plan approvals and state access restrictions.
Unlock Full Question Bank
Get access to hundreds of Code Quality and Review interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.