Skip to content

Security Engineer interview questions

100 real questions with model answers and explanations for Security Analyst candidates.

See a Security Engineer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Questions

fundamentals

The CIA triad states the three core security goals: confidentiality, integrity, and availability.

  • Confidentiality limits payroll data to authorized readers.
  • Integrity detects unauthorized changes, for example with a signed release artifact.
  • Availability keeps a service usable through redundancy, backups, and denial-of-service protection.

Why interviewers ask this: The interviewer checks whether you connect each goal to a concrete control.

vulnerabilitiesrisk-managementvulnerability-management

A threat can cause harm, a vulnerability is a weakness, and risk combines the likelihood and impact of exploitation.

  • An internet attacker is a threat; an unpatched public server is a vulnerability.
  • Risk rises when that server stores customer data and a working exploit is public.
  • Patching or restricting exposure lowers risk even though the threat remains.

Why interviewers ask this: A strong answer separates the terms and shows how a control changes risk.

risk-management

Likelihood estimates how probable an event is, while impact estimates its damage.

  • Active exploitation makes a public service more likely to be attacked than an isolated lab host.
  • Loss of a test page has less impact than theft of production payment data.
  • Teams use both dimensions to prioritize work instead of treating every finding equally.

Why interviewers ask this: The interviewer evaluates whether you can prioritize risk using probability and consequence.

fundamentalsattack-surface

An attack surface is every reachable point where an attacker can interact with a system.

  • It includes APIs, ports, login pages, uploads, accounts, integrations, and physical access.
  • Forgotten subdomains and unused admin endpoints still count while reachable.
  • Removing an unnecessary service or permission is stronger than only monitoring it.

Why interviewers ask this: The interviewer checks whether you understand exposure and attack-surface reduction.

least-privilegeaccess-control

Least privilege gives each user and service only the permissions needed for its current job.

  • A reporting service that reads invoices should not have database delete rights.
  • Administrative access should be temporary rather than attached to a daily account.
  • Periodic reviews remove access that remains after a role or responsibility changes.

Why interviewers ask this: A strong answer applies least privilege to both people and workloads.

fundamentalsdefense-in-depth

Defense in depth uses independent layers so one failed control does not expose the whole system.

  • Parameterized queries prevent SQL injection; limited database rights reduce remaining damage.
  • MFA helps after password theft; session monitoring can still detect abuse.
  • Tested backups reduce impact when preventive and detective controls both fail.

Why interviewers ask this: The interviewer looks for complementary layers with different failure modes.

risk-management

A team can avoid, reduce, transfer, or accept a risk after assessing it.

  • Avoidance can retire an unused public service; reduction can patch it and restrict access.
  • Insurance or contracts transfer some loss but do not remove technical responsibility.
  • Acceptance must be explicit, time-bounded, documented, and owned by an authorized person.

Why interviewers ask this: The interviewer checks whether risk acceptance is a decision rather than inaction.

The control type says whether it stops an event, reveals it, or restores a safe state.

  • MFA is preventive because it blocks many logins using stolen passwords.
  • An impossible-travel alert is detective because it reveals suspicious account use.
  • Revoking sessions and restoring a backup are corrective actions after compromise.

Why interviewers ask this: A strong answer distinguishes control timing with realistic examples.

Secure by default means a new system starts in the safer state without manual hardening.

  • New accounts receive no privileged role until it is deliberately granted.
  • A new storage bucket starts private rather than publicly readable.
  • Compatibility options must not silently disable TLS checks, authentication, or audit logs.

Why interviewers ask this: The interviewer evaluates whether you recognize safe defaults as protection from configuration mistakes.

threat-modeling

A trust boundary is where data or control crosses between components with different trust levels.

  • Browser input crossing into an API is untrusted even when the normal UI created it.
  • An application calling a database crosses a boundary controlled by credentials and network rules.
  • Each crossing needs caller identification, validation, authorization, and useful security logging.

Why interviewers ask this: The interviewer checks whether you can place security checks at system boundaries.

http

Every client-controlled part of an HTTP request is untrusted.

  • Paths, query values, headers, cookies, and bodies can all be changed with curl or a proxy.
  • Content-Type describes data but does not prove that the data is safe.
  • The server validates type, length, format, business rules, and authorization before use.

Why interviewers ask this: A strong answer rejects trust in browser-generated values and headers.

http

HTTP methods express intent, so controls should match whether a request reads or changes state.

  • GET and HEAD should not delete data because links and crawlers may trigger them.
  • State-changing methods need authorization and CSRF protection with cookie sessions.
  • A method name is not access control, so every endpoint still checks permission.

Why interviewers ask this: The interviewer connects HTTP semantics with state-changing security controls.

http

Errors should help the client act without exposing internals useful to an attacker.

  • Return a stable message, not a stack trace, SQL query, filesystem path, or secret.
  • Log details server-side with a correlation ID that support can match to the response.
  • Login errors should avoid confirming whether a particular account exists.

Why interviewers ask this: The interviewer evaluates the balance between useful errors and information disclosure.

sessionscookies

Session cookies normally use Secure, HttpOnly, and an appropriate SameSite value.

  • Secure sends the cookie only over HTTPS.
  • HttpOnly blocks JavaScript reads, limiting token theft during many XSS attacks.
  • SameSite reduces cross-site sending; narrow Domain, Path, and expiry further limit exposure.

Why interviewers ask this: A strong answer explains the distinct threat reduced by each cookie attribute.

The same-origin policy stops a page from freely reading data from another origin.

  • An origin combines scheme, host, and port, so HTTP and HTTPS origins differ.
  • Some cross-origin requests can be sent, but JavaScript usually cannot read their responses.
  • CORS relaxes this boundary for approved origins; forms and embedded resources follow separate rules.

Why interviewers ask this: The interviewer checks whether you understand the browser boundary modified by CORS.

cors

CORS is a browser-enforced policy controlling which origins may read cross-origin responses.

  • The browser sends Origin and may issue a preflight OPTIONS request.
  • Servers should allow specific origins, especially when credentials are enabled.
  • CORS is not authentication, does not stop curl, and does not replace CSRF protection.

Why interviewers ask this: A strong answer explains both browser enforcement and CORS limitations.

validation

Client validation improves usability, but the user controls the client.

  • An attacker can remove JavaScript checks, edit hidden fields, or use Burp Suite.
  • The server must enforce value, size, business-rule, and ownership checks.
  • Hiding an admin button does not protect the underlying endpoint from direct requests.

Why interviewers ask this: The interviewer checks whether enforcement remains on the server.

tlscryptography

TLS provides confidentiality, integrity, and endpoint authentication for data in transit.

  • Encryption prevents a network observer from reading application traffic.
  • Integrity checks make undetected modification impractical.
  • Certificate validation confirms server identity, but TLS does not make application code safe.

Why interviewers ask this: A strong answer covers all three properties and an important limit.

cryptography

A certificate warning means the browser could not establish a trusted identity for the site, so do not bypass it or enter sensitive data.

  • Check the URL and your device clock because a wrong hostname or invalid date can trigger a warning.
  • The browser normally checks the hostname and a certificate chain leading to a trusted certificate authority.
  • Stop and report the warning; do not enter passwords or payment data until the problem is fixed.

Why interviewers ask this: The interviewer checks your basic response to a certificate warning and your understanding of the trust chain.

network-securitydnsnetworking

DNS finds an IP for a hostname, a port selects a service, and a firewall controls connections.

  • A browser can resolve app.example.com and connect to TCP port 443.
  • The hostname still matters for TLS validation and HTTP virtual hosting.
  • An allowed port still needs secure code, authentication, and authorization behind it.

Why interviewers ask this: The interviewer checks basic networking without treating a firewall as complete AppSec.

Locked questions

  • 21

    What is injection as a vulnerability class?

    injectionvulnerabilitiesvulnerability-management
  • 22

    How does SQL injection happen, and how is it prevented?

    injectionweb-attackssql
  • 23

    What is operating-system command injection?

    injectionsystem-design
  • 24

    What is cross-site scripting, or XSS?

    xssweb-attacks
  • 25

    What is cross-site request forgery, or CSRF?

    csrfweb-attacks
  • 26

    What is server-side request forgery, or SSRF?

    ssrf
  • 27

    What is a path traversal vulnerability?

    vulnerabilitiesvulnerability-managementpath-traversal
  • 28

    Why is insecure deserialization dangerous?

  • 29

    What counts as a security misconfiguration?

    web-attacks
  • 30

    What security checks apply to file uploads?

  • 31

    What is the difference between authentication and authorization?

    authidentity-access
  • 32

    How should passwords be stored?

    passwords
  • 33

    What are salts and peppers in password storage?

    passwords
  • 34

    How does a server-side session work?

    sessions
  • 35

    What protections should a session have?

    sessions
  • 36

    What is a JWT, and what are its three parts?

    jwt
  • 37

    Which checks are required when validating a JWT?

    jwtvalidation
  • 38

    What problem does multi-factor authentication solve?

    authidentity-accessmfa
  • 39

    How do RBAC and ABAC differ?

    rbacidentity-accessabac
  • 40

    What is IDOR or broken object-level authorization?

    authidentity-access
  • 41

    How do encoding, hashing, and encryption differ?

    encryptioncryptography
  • 42

    How do symmetric and asymmetric cryptography differ?

  • 43

    What does a digital signature prove?

    cryptography
  • 44

    Why are secure randomness, nonces, and IVs important?

    cryptography
  • 45

    How do SAST and DAST differ?

    sastdast
  • 46

    What do SCA and an SBOM provide?

    supply-chain
  • 47

    How should application secrets be managed?

    secrets
  • 48

    What basic security practices apply to containers?

    containers
  • 49

    How do CVE and CVSS help vulnerability management?

    vulnerabilitiesvuln-managementvulnerability-management
  • 50

    What are the basic stages of vulnerability management?

    vulnerabilitiesvuln-managementvulnerability-management
  • 51

    Semgrep flags SQL injection where a search term reaches a PostgreSQL query. How would you validate and triage it?

    injectionvalidationweb-attacks
  • 52

    OWASP ZAP reports reflected XSS on the staging search page. What would you check before filing it as confirmed?

    xssowasp
  • 53

    Snyk finds a high-severity CVE in a transitive npm package used by an API service. How would you triage it?

    vuln-managementcveapi
  • 54

    SonarQube marks the string `test-password` in a unit test as a hardcoded credential. How would you handle the finding?

    passwordsunit
  • 55

    A DAST scan says the HTTPS login response lacks HSTS, but the application is behind CloudFront. How would you triage it?

    dastcloud-securityaws
  • 56

    An SCA gate blocks a release for a critical CVE in a development-only test runner. What would you do?

    vuln-managementcve
  • 57

    CodeQL reports path traversal in an archive extraction helper. How would you validate the report?

    validationpath-traversal
  • 58

    Burp Scanner reports CSRF on an account settings request. How would you decide whether it is exploitable?

    csrfattacksappsec-tools
  • 59

    Trivy reports 18 high OS-package vulnerabilities in a container based on Debian. How would you prioritize them?

    vulnerabilitiescontainers
  • 60

    Semgrep, ZAP, and Snyk create three tickets that appear to describe the same vulnerable upload endpoint. How would you triage them?

    vulnerabilitiesendpoints
  • 61

    A Node.js search endpoint concatenates `q` into a SQL LIKE clause. How would you fix it?

    sqlendpoints
  • 62

    User comments stored as Markdown execute script when viewed in the admin page. How would you remediate it?

  • 63

    A profile page assigns the `bio` API field to `element.innerHTML`. How would you fix and verify the DOM XSS risk?

    xssrisk-managementapi
  • 64

    A URL-preview feature can fetch `http://127.0.0.1:3000/admin`. How would you fix the SSRF?

    ssrfhttpnetworking
  • 65

    A download route joins an upload directory with the request parameter `filename`. How would you prevent path traversal?

    joinspath-traversal
  • 66

    An API returns `Access-Control-Allow-Origin: *` together with credentials. What would you check before changing the CORS configuration?

    corsconfig
  • 67

    A production error page exposes a Django stack trace and environment settings. What would you change?

    frameworksdebuggingtracing
  • 68

    An avatar upload trusts the `.jpg` extension and stores files under the web root. How would you harden it?

  • 69

    After login, the application redirects to any URL supplied in `next`. How would you remove the open redirect?

  • 70

    A payment confirmation page can be embedded in an external iframe. How would you fix the clickjacking risk?

    risk-management
  • 71

    How would you test a login endpoint for basic brute-force and account-enumeration weaknesses?

    endpoints
  • 72

    How would you test a password-reset flow before release?

    passwords
  • 73

    A user changes their password but an existing browser session stays active. How would you test and report this?

    passwordssessions
  • 74

    The application gives visitors a session cookie before login. How would you test it for session fixation?

    sessionscookies
  • 75

    A JWT contains `role: admin`. How would you check that changing the claim cannot grant admin access?

    jwt
  • 76

    How would you test `GET /api/invoices/{id}` for IDOR?

    api
  • 77

    A project API has viewer and editor roles. What authorization checks would you test?

    authidentity-accessapi
  • 78

    The admin button is hidden for normal users, but the API route has no visible role check. How would you verify and fix it?

    api
  • 79

    How would you review a long-lived `remember me` session cookie?

    sessionscookies
  • 80

    How would you test an MFA recovery-code flow?

    identity-access
  • 81

    Gitleaks finds a private key in a GitHub Actions pull-request build. What would you do first?

    ci-cd
  • 82

    A released container image contains a project `.npmrc` with a working private-registry token. What would you do?

    containersregistriestokens
  • 83

    Dependabot proposes a patch update for a vulnerable direct dependency. How would you move it safely to production?

    vulnerabilitiesdependencies
  • 84

    A critical library CVE has no compatible patch for your current framework version. What can a junior engineer do?

    vuln-managementcve
  • 85

    A Docker image runs a Node.js API as root. What basic hardening change would you make?

    dockerapi
  • 86

    A production image contains compilers, curl, and the full source tree. How would you reduce its attack surface?

    fundamentalsattack-surfacehttp-tools
  • 87

    Application logs contain Authorization headers and password-reset links. How would you remediate this?

    authpasswordsidentity-access
  • 88

    How would you add Trivy image scanning to a GitHub Actions pipeline without making it permanently noisy?

    ci-cd
  • 89

    How would you create and use an SBOM for a small containerized service?

    supply-chaincontainers
  • 90

    What basic security scanning workflow would you set up for a 12-person web team?

  • 91

    What should you put in a Jira ticket for a confirmed critical vulnerability?

    vulnerabilitiesvulnerability-management
  • 92

    A critical upload vulnerability needs an emergency patch today. How would you support the remediation without losing evidence?

    vulnerabilitiesvulnerability-management
  • 93

    Support reports that a stored XSS may have executed in two staff browsers. What should you do?

    xss
  • 94

    Logs suggest a SQL injection flaw was probed on a public endpoint. How would you assist with containment and investigation?

    injectionweb-attacksincident-response
  • 95

    A public support ticket contains a link to a customer export with an embedded access token. How would you respond?

    tokens
  • 96

    An image-conversion endpoint previously built a shell command from the uploaded filename, and the fix now uses `spawn` with an argument array. How would you retest it?

    endpoints
  • 97

    A developer marks a vulnerability resolved, but the same Semgrep rule still fails on the release branch. What would you do?

    vulnerabilitiesvulnerability-management
  • 98

    A dependency update fixes a CVE but breaks one integration test. How would you help the team proceed?

    vuln-managementcveintegration
  • 99

    A product owner asks you to accept a high vulnerability risk indefinitely because exploitation is inconvenient. How would you respond?

    vulnerabilitiesattacksrisk-management
  • 100

    What would you verify before closing a vulnerability that was involved in a small security incident?

    vulnerabilitiesvulnerability-managementincidents