InterviewStack.io LogoInterviewStack.io

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
119 practiced

You are reviewing automation code that performs TLS certificate rotation for internal services. Identify failure modes, security checks, and test cases you would require. Propose a robust design for rotation that avoids downtime, supports emergency rollback, and ensures private key secrecy during rotation.

MediumTechnical
80 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.

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']

Provide at least three tests and explain why you chose them.

HardTechnical
70 practiced

Security review: you find an IaC change that opens a security group to 0.0.0.0/0 for SSH and stores a service account key in a repo variable file. As the reviewer, propose a remediation plan that enforces least privilege, performs minimal disruption, and includes a migration path to rotate credentials and tighten rules. Include both code changes and rollout steps.

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.

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.