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.

HardTechnical
88 practiced

A provisioning script currently creates thousands of cloud resources in a tight loop and runs for hours. As a reviewer, analyze the likely bottlenecks and propose an architecture-level and implementation-level redesign to scale provisioning to tens of thousands of resources reliably. Discuss batching, async/concurrency, provider API limits, idempotence, retries, and cost control.

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.

MediumTechnical
106 practiced

You are assigned to review a PR that adds extensive logging. What do you check for specifically when reviewing logging and observability changes? Provide a concrete example of logging you'd block a PR over and how you'd fix it.

HardTechnical
87 practiced

Case-study: After an outage caused by a deployment automation bug, outline the steps of a blameless post-incident code review. Include how to identify contributing code, assess test gaps, propose fixes, validate changes, and update process and tools to prevent recurrence. Give a short checklist a reviewer should follow during the post-incident review.

EasyTechnical
88 practiced

You are reviewing a Kubernetes deployment manifest in a PR. The file (excerpt) is:

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingest
spec:
  replicas: 3
  template:
    spec:
      containers:
      - name: ingester
        image: mycompany/ingester:latest

List missing operational and security best practices you would require (resource requests/limits, probes, image policies, RBAC, securityContext, labels, etc.) and provide the exact changes you would request in the PR.

Unlock Full Question Bank

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