Code Review and Working with Existing Codebases Questions

Reviewing others' code and navigating unfamiliar systems: giving and receiving actionable review feedback, spotting correctness and design issues, and reading and understanding large or legacy codebases before changing them. Covers collaborative coding norms, incremental change in shared repositories, and verifying changes against existing behavior. The team-facing side of day-to-day engineering.

EasyTechnical
67 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
67 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.

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)

Assume get_metadata may raise exceptions and is non-blocking I/O bound.

EasyBehavioral
73 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
60 practiced

You find a change in a PR that appears to add API keys and database passwords as plain text constants in a repository. As the reviewer, what steps do you take immediately and what long-term code-review policies and automated checks would you recommend to prevent credentials from being committed? Include remediation for secrets already committed to history.

MediumSystem Design
80 practiced

Design a code-review checklist specifically for Terraform modules in a large, multi-team organization, covering everything from module interface design to security posture. Provide the checklist and explain why each item matters at organizational scale.

Unlock Full Question Bank

Get access to all 32 Code Review and Working with Existing Codebases interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.