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

HardSystem Design
64 practiced

You are reviewing a data migration that renames a heavily used column and requires backfilling millions of rows. Design a rollback-safe migration strategy that can be reviewed and approved. Cover schema changes, dual-write/read strategies, backfills, verification, monitoring, and how code review should verify each migration step.

MediumTechnical
86 practiced

A PR adds a GitHub Actions workflow that builds artifacts and deploys to production. Review the YAML below and identify security, caching, and reliability issues. Suggest concrete fixes.

yaml
name: deploy
on: [push]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: echo $SECRET_KEY
      - run: curl -sL https://example.com/install.sh | bash
      - run: ./deploy.sh

What would you change and why?

MediumTechnical
131 practiced

You are responsible for integrating static-analysis tools for a compiled monitoring agent written in Go. As a reviewer, which tools/checks would you require in CI and which classes of defects do they catch (formatting, race conditions, undefined behavior, performance issues)? Explain how to prioritize fixes found by these tools in PR reviews.

MediumTechnical
79 practiced

How would you detect secrets leaked in a PR or git history, and what would you actually do about it: immediate reviewer actions, secret rotation, and cleaning up the history? Name the tools you'd reach for and walk through the trade-offs of your remediation approach.

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.