Skip to content

Interview question · Application & API Security

How do you conduct a security code review, and what do you look at first?

Reading files top to bottom finds style issues. A security review starts from sources, sinks and the checks between them, and AI code adds a new source.

mediumEssentialNewPreparation tags: Amazon, Meta, GoogleUpdated Nov 2026

TL;DR: Start with context (what the code does, who calls it, what it protects), then trace untrusted sources to dangerous sinks and check what stands between them: authentication, authorization on the specific object, validation, encoding, parameterisation. Look first at entry points, authorization logic, data access, and calls to interpreters, file systems, network fetchers and deserializers. In AI features, treat model output and tool arguments as untrusted sources. Report findings with a concrete exploit path, impact and fix.

How to approach it

Describe a method, not a checklist recitation: scope, map, trace, verify, report. Say what you look at first and why. Interviewers often hand you code afterwards, so show the habit of tracing data flow.

A strong answer

FIG · SECURITY CODE REVIEW · SOURCES TO SINKS
Context first, then what stands between untrusted input and danger

Context

what it protects

Sources

requests, files, model output

Between them

authn, authz, validation

Sinks

SQL, shell, HTML, files

Findings

impact and fix

1. Context first (minutes, not hours). What does this change do, who can reach it (anonymous, users, internal services, the model), and what does it touch (money, personal data, credentials, other tenants)? Read the design or ticket. This tells you which bugs would matter.

2. Map entry points and trust boundaries. HTTP routes, message consumers, scheduled jobs, webhook receivers, tool handlers called by an LLM. Note which authenticate and how.

3. Trace sources to sinks.

Sources (untrusted)Sinks (dangerous)Check that should sit between
Request params, headers, bodiesSQL / query buildersParameterisation
Uploaded files, archivesShell, subprocessArgument arrays, allowlists
Webhooks, third-party API responsesHTML renderingContextual encoding, sanitisation
Model output, tool-call argumentsFile pathsResolve and confine to a root
Retrieved documentsOutbound HTTPDestination validation
Environment from other tenantsDeserializersData-only formats
Data access by IDObject-level authorization

4. What I look at first.

  1. Authorization on data access. Every query or fetch by ID: is the object checked against the caller and tenant? This is the most common serious bug.
  2. Authentication boundaries. New routes default to authenticated? Webhooks verify signatures with constant-time comparison?
  3. Interpreter and system calls. Any string-built query, shell call, template compilation, eval, or deserialization of external data.
  4. Secrets and crypto. Hard-coded keys, disabled TLS verification, custom crypto, tokens in logs.
  5. AI-specific sinks. Model output rendered as HTML, passed to tools, used in paths or queries; tool handlers that trust model-supplied IDs.

5. Verify, then report. Confirm exploitability with a quick test where possible. Each finding states the path (source, sink, missing check), the impact in terms of an asset, a severity, and a concrete fix with code. Separate must-fix from defence-in-depth suggestions.

Scale. Automate what can be automated (SAST rules for known sinks, secret scanning, dependency checks) and spend human time on authorization logic and business rules, which tools miss.

What interviewers probe next

  • "You have 30 minutes for a 2,000-line change. What do you do?" Context, then authorization and data access, then interpreter calls; note what you did not review.
  • "How do you review code written by an AI assistant?" Same method, with extra attention to plausible-looking but unchecked authorization, invented package names, and disabled validation.
  • "How do you keep developers receptive to findings?" Clear exploit paths, fixes with code, and severity they can trust.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

You have one day to security-review a 20,000-line service before launch, including a new AI summarisation feature.

  1. Start here

    Where do you start?

How it's scored

Weak: Reads line by line for "bad functions" with no prioritisation.

Hire: Describes source-to-sink tracing, prioritises authorization and interpreter calls, and reports with impact and fixes.

Strong Hire: Starts from context and trust boundaries, includes AI-specific sources and sinks, balances automation with manual review, and states review scope honestly.

Common mistakes

  • Spending the review on style or minor issues while missing authorization.
  • Treating model output or tool arguments as trusted.
  • Reporting findings without an exploit path or fix.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.