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.

MediumTechnical
123 practiced

You are reviewing a teammate's pull request that adds memoization to a function. What checks would you perform in code review to ensure correctness, memory safety, and thread-safety? Provide concrete review comments you might leave.

MediumTechnical
87 practiced

A PR changes logic that affects billing calculations. As a reviewer, list specific review checks you would perform to ensure correctness and compliance, including unit tests with edge cases, integration tests with realistic data, auditability of changes, and approvals required from finance or product stakeholders.

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).

HardTechnical
74 practiced

Design a set of static analysis rules to detect common concurrency bugs in a Java codebase. Provide at least four rules, explain the detection heuristic and likely false positives for each, and suggest mitigations.

Unlock Full Question Bank

Get access to all 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.