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.
EasyTechnical
73 practiced
You are reviewing a short Bash script authored by an operations engineer. Identify bugs, anti-patterns, portability and safety concerns, and propose fixes. The script:What would you comment on in the PR, and how would you rewrite or patch this script to be safer and idempotent?
bash
#!/bin/bash
DIR=$1
if [ ! -d $DIR ]; then
mkdir $DIR
fi
for file in $(ls $DIR); do
sudo echo 'Processing' $file
rm -rf $DIR/$file
doneHardTechnical
93 practiced
Technical debugging: review the following Python snippet intended to concurrently fetch metadata for hosts. Identify race conditions and concurrency issues, and propose a corrected, thread-safe implementation with reasoning.Assume get_metadata may raise exceptions and is non-blocking I/O bound.
python
import threading
hosts = ['a','b','c']
results = []
def fetch(h):
data = get_metadata(h)
results.append((h, data))
threads = []
for h in hosts:
t = threading.Thread(target=fetch, args=(h,))
threads.append(t)
t.start()
for t in threads:
t.join()
print(results)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.
MediumTechnical
80 practiced
A developer added several new logging statements across an automation library. As a reviewer, what should you check about those logs (format, level, PII, performance, correlation) and what edits would you request? Give examples of good and bad log lines, and explain how to make logs actionable for operations.
HardTechnical
87 practiced
Leadership: You're in a large engineering org where reviewers are overloaded and PR latency is high. Propose a scalable manual-review strategy combining automation, triage, reviewer assignment rules, and code ownership. Explain how to maintain quality while reducing time-to-merge and preventing reviewer burnout.
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.