Interview Questions (with Counter Questions)

Interviewers rarely stop at the first answer. They push back with a counter question to see if you really understand the trade-off. Each question below has a short model answer, then the follow-ups you should expect.

Tip: when you get a counter question, don't change your answer to please the interviewer. Say when your answer holds and when it breaks.


01 — Authentication

Q: How do you store user passwords?

Answer: Hash with a slow, salted, memory-hard algorithm: Argon2id (or bcrypt with cost ≥ 12). Never encrypt, never use MD5/SHA-256 alone.

Counter questions:

  • Why not SHA-256 with a salt? → SHA-256 is fast. A GPU can try billions per second. Password hashing must be slow on purpose.
  • Why not encrypt the password? → Encryption is reversible. If the key leaks, every password leaks. You never need the original password, only to verify it.
  • What is a pepper and do you need one? → A secret added to every hash, stored outside the DB (env / KMS). It helps if only the DB leaks. Nice extra, not a replacement for a good hash.
  • bcrypt has a 72-byte limit. Does that matter? → Long passphrases get cut silently. Argon2id has no such limit, so prefer it for new systems.
  • How do you upgrade old MD5 hashes without forcing a reset? → On next successful login, verify the old hash, then re-hash with Argon2id and save. Or wrap now: argon2(md5(pw)).

Q: How do you stop brute-force login attacks?

Answer: Rate limit per IP and per account, progressive delays, MFA, and breached-password checks.

Counter questions:

  • If you lock the account after 5 failures, what's the problem? → An attacker can lock out any user on purpose (DoS). Use temporary lockout / backoff, not permanent lock.
  • Attacker uses 10,000 IPs (credential stuffing). Now what? → Per-IP limits fail. Add per-account limits, CAPTCHA after failures, device fingerprinting, breached-password check, and MFA.
  • Your login says "user not found" vs "wrong password". Issue? → User enumeration. Return the same message and similar response time for both.

Q: How does MFA with TOTP work?

Answer: Server and app share a secret. Both compute HMAC(secret, floor(time/30)) → 6 digits. Server accepts the current code (± one window).

Counter questions:

  • Is SMS OTP good enough? → Better than nothing, but SIM swapping and SS7 attacks exist. Prefer TOTP or passkeys/WebAuthn.
  • How do you stop the same TOTP code being used twice? → Store the last used time-step per user and reject repeats.
  • User lost their phone. What then? → One-time backup codes (hashed like passwords), plus a strong identity-verification recovery flow.

02 — Authorization

Q: What is the difference between authentication and authorization?

Answer: Authentication = who are you? Authorization = what are you allowed to do?

Counter questions:

  • What is IDOR? → Insecure Direct Object Reference: /orders/123 returns any order because the code checks login but not ownership. Fix: WHERE id = ? AND user_id = ?.
  • Should you return 403 or 404 for someone else's resource? → 404 hides that the resource exists. 403 is fine when existence is not secret.
  • Is using UUIDs instead of numeric IDs enough to fix IDOR? → No. It makes guessing harder but IDs leak (URLs, logs, shares). You still need the ownership check.
  • RBAC vs ABAC? → RBAC: permissions by role (admin, editor). ABAC: rules on attributes (owner, department, time). Real apps usually mix: role + "is owner".

Q: Where should authorization checks live?

Answer: On the server, close to the data access, in one central place (policy layer / middleware), deny by default.

Counter questions:

  • The frontend already hides the admin button. Isn't that enough? → No. Anyone can call the API directly with curl/Postman.
  • What about mass assignment? → User.update(req.body) lets a user send role: "admin". Whitelist allowed fields.

03 — Input Validation

Q: Allowlist or denylist validation?

Answer: Allowlist. Define exactly what is valid (type, length, format, range) with a schema (zod/joi) and reject the rest.

Counter questions:

  • Isn't validation enough to stop SQL injection and XSS? → No. Validation reduces risk; the real fix is context-specific: parameterized queries for SQL, output encoding for HTML.
  • We validate on the frontend. Why again on the backend? → Frontend validation is for UX. The backend is the trust boundary; requests can skip the frontend.
  • What is HTTP parameter pollution? → ?role=user&role=admin becomes an array and can bypass checks. Use hpp or strict schema types.

04 — Injection

Q: How do you prevent SQL injection?

Answer: Parameterized queries / prepared statements, or an ORM used correctly. Never build SQL with string concatenation.

Counter questions:

  • Can you use a parameter for a table or column name (e.g. sort by)? → No, placeholders are for values only. Map user input to an allowlist: { name: 'name', date: 'created_at' }.
  • Does an ORM make you 100% safe? → No. Raw query methods ($queryRawUnsafe, knex.raw with interpolation) are still injectable.
  • MongoDB has no SQL. Is it safe? → No. { "password": { "$ne": null } } is NoSQL injection. Validate types and strip $ keys.
  • What about command injection? → Avoid exec with user input. Use execFile/spawn with an argument array, and allowlist values.
  • Is stored procedure use safe automatically? → Only if it doesn't build dynamic SQL inside with concatenation.

05 — XSS and CSP

Q: What is XSS and what are its types?

Answer: Attacker's script runs in another user's browser. Types: stored (saved in DB), reflected (from URL/request), DOM-based (client JS writes untrusted data to the DOM).

Counter questions:

  • React escapes output. So React apps can't have XSS? → They can: dangerouslySetInnerHTML, href="javascript:...", injecting into <script>, third-party scripts.
  • Sanitize on input or encode on output? → Encode on output, per context (HTML, attribute, JS, URL). Sanitize (DOMPurify) only when you must allow rich HTML.
  • What does CSP do and can it replace escaping? → It limits which scripts can run (script-src 'self' 'nonce-…'). It is a second layer, not a replacement.
  • Why is 'unsafe-inline' bad in CSP? → It allows any inline script, which is exactly what XSS injects. Use nonces or hashes.
  • How does HttpOnly help? → JS cannot read the cookie, so XSS can't steal the session. But XSS can still make requests as the user.

06 — CSRF

Q: What is CSRF and how do you prevent it?

Answer: A malicious site makes the victim's browser send a request with their cookies. Prevent with SameSite=Lax/Strict cookies, CSRF tokens, and checking Origin.

Counter questions:

  • We use JWT in the Authorization header. Do we need CSRF protection? → No, browsers don't attach headers automatically. If the JWT is in a cookie, yes you do.
  • Isn't SameSite=Lax enough? → Mostly, but Lax allows top-level GET, so GET must never change state. Old browsers and subdomain attacks are edge cases; add tokens for sensitive actions.
  • Does CORS protect against CSRF? → No. CORS controls who can read the response; a simple form POST is still sent.
  • What is the double-submit cookie pattern? → Token in a cookie and in a header/body; server checks they match. Sign it (HMAC) so a subdomain can't plant one.

07 — Sessions and JWT

Q: Session vs JWT — which do you use?

Answer: Server sessions (cookie + Redis) for typical web apps: easy revoke. JWT for stateless service-to-service or when many services must verify tokens without a shared store.

Counter questions:

  • How do you log out / revoke a JWT? → You can't directly. Use short-lived access tokens (5–15 min) + refresh tokens stored server side, or a denylist by jti.
  • Where do you store the JWT in the browser? → HttpOnly, Secure, SameSite cookie. localStorage is readable by any XSS.
  • What is the alg: none attack? → Token says no signature, a weak library accepts it. Always pin the algorithm on verify: verify(token, key, { algorithms: ['RS256'] }).
  • HS256 vs RS256? → HS256: one shared secret signs and verifies. RS256: private key signs, public key verifies, so other services can verify without being able to sign.
  • What is refresh token rotation? → Each refresh returns a new refresh token and invalidates the old one. If an old one is reused, revoke the whole family (it was stolen).
  • What is session fixation? → Attacker sets a known session ID before login. Fix: regenerate the session ID on login.

08 — Rate Limiting

Q: How do you implement rate limiting?

Answer: Middleware with a counter per key (IP, user, API key) using fixed window, sliding window, or token bucket. Store counters in Redis when you run more than one instance.

Counter questions:

  • Why does in-memory rate limiting break in production? → Each instance has its own counter; 4 instances = 4× the limit. Use a shared store.
  • Behind a load balancer, every request comes from the same IP. Fix? → app.set('trust proxy', 1) to read X-Forwarded-For, but trust only your own proxy hops or attackers can spoof the header.
  • Fixed window vs token bucket? → Fixed window allows a burst of 2× at window edges. Token bucket smooths it and allows controlled bursts.
  • What status code and headers? → 429 Too Many Requests with Retry-After / RateLimit-* headers.
  • Is app-level rate limiting enough for DDoS? → No. Large floods must be stopped earlier: CDN/WAF (Cloudflare, AWS Shield).

09 — Secrets Management

Q: How do you manage secrets?

Answer: Never in code or git. Use env vars in dev, a secrets manager (AWS Secrets Manager, Vault) in prod, validate on startup, rotate regularly.

Counter questions:

  • A developer pushed an API key to GitHub and deleted it in the next commit. Done? → No. It's still in history and bots scrape GitHub in seconds. Rotate the key first, then clean history.
  • Are env vars secure? → Better than code, but they leak via /proc, crash dumps, logs, child processes. A secrets manager with short-lived credentials is better.
  • How do you stop this happening again? → Pre-commit hook with gitleaks, GitHub secret scanning / push protection.

10 — Security Headers and CORS

Q: Which security headers do you set?

Answer: Via helmet: CSP, HSTS, X-Content-Type-Options: nosniff, X-Frame-Options/frame-ancestors, Referrer-Policy. Remove X-Powered-By.

Counter questions:

  • What does HSTS protect against, and what's the risk? → SSL stripping (downgrade to HTTP). Risk: with a long max-age and includeSubDomains, a subdomain without HTTPS breaks for a year.
  • What's wrong with Access-Control-Allow-Origin: * plus credentials? → Browsers block that combo. The dangerous version is reflecting any Origin with Allow-Credentials: true: any site can read user data.
  • Is CORS a server-side security control? → No, the browser enforces it. curl ignores CORS. Your API still needs auth.
  • What's a preflight request? → An OPTIONS request the browser sends before non-simple requests (custom headers, PUT/DELETE, JSON) to ask permission.

11 — Error Handling and Logging

Q: What should you log and what should you never log?

Answer: Log auth events, access denials, input validation failures, admin actions, with request ID and user ID. Never log passwords, tokens, full card numbers, or sensitive PII.

Counter questions:

  • Why not send the stack trace to the client? → It reveals file paths, library versions, and queries. Return a generic message + request ID; log details server side.
  • How do you stop secrets leaking into logs by accident? → Logger redaction (pino redact paths), structured logs, never log whole req.body/headers.
  • What is log injection? → User input with newlines fakes log entries. Structured JSON logging avoids it.
  • Logs exist but nobody looks. Problem? → Yes (OWASP A09). You need alerts on patterns: login failure spikes, 403 spikes, new admin created.

12 — File Uploads

Q: How do you secure file uploads?

Answer: Limit size, check real file type by magic bytes, random file names, store outside web root (S3 / private bucket), serve with correct Content-Type and Content-Disposition, scan for malware.

Counter questions:

  • We check the extension and Content-Type header. Enough? → No, both come from the client. Check magic bytes (file-type).
  • Why not keep the original filename? → Path traversal (../../etc/passwd), overwrite, and stored XSS in names. Generate a UUID.
  • Can an image be dangerous? → SVG can contain JS. Images can hide payloads (polyglots). Re-encode images with sharp; serve SVG as download or from another domain.
  • What is a zip bomb? → Small file that decompresses to GBs. Limit decompressed size and number of entries.

13 — SSRF

Q: What is SSRF?

Answer: The server fetches a URL the user controls, so the attacker reaches internal services, e.g. http://169.254.169.254/ cloud metadata to steal credentials.

Counter questions:

  • We block localhost and 127.0.0.1 with a regex. Safe? → No. 0.0.0.0, [::1], 2130706433, 127.1, and domains that resolve to internal IPs all bypass it.
  • We resolve DNS and check the IP, then fetch. Safe? → DNS rebinding: first lookup returns a public IP, second returns internal. Connect to the IP you checked (pin it) or use ssrf-req-filter.
  • What about redirects? → A public URL can redirect to an internal one. Disable redirects or re-check every hop.
  • Infra-level fix? → IMDSv2 on AWS, egress firewall, run fetchers in an isolated network.

14 — Data Protection and Encryption

Q: Encryption in transit vs at rest?

Answer: In transit: TLS 1.2+ everywhere, including internal traffic. At rest: disk/DB encryption, plus field-level encryption for very sensitive data.

Counter questions:

  • Hashing vs encryption vs encoding? → Hashing: one way. Encryption: reversible with a key. Encoding (base64): no security at all.
  • Which algorithm for encrypting a field? → AES-256-GCM (authenticated). Never ECB. Random unique IV per message.
  • Why is GCM better than CBC? → GCM detects tampering (auth tag). CBC without a MAC is open to padding oracle attacks.
  • Where do you keep the encryption key? → Not next to the data. KMS / Vault, with envelope encryption (a data key encrypted by a master key).
  • How do you generate a reset token? → crypto.randomBytes(32), store only its hash, short expiry, single use. Never Math.random().
  • Disk encryption is on. Is the DB data safe if someone gets SQL access? → No. Disk encryption only helps if the physical disk is stolen. The DB decrypts for any query.

15 — Dependency Security

Q: How do you handle vulnerable dependencies?

Answer: Lockfile committed, npm audit / Snyk / Dependabot in CI, update regularly, remove unused packages.

Counter questions:

  • npm audit shows 50 vulnerabilities. Fix all now? → Triage: is it reachable in prod code? Dev-only? Exploitable in our usage? Fix critical reachable ones first.
  • What is a supply chain attack? → Malicious code in a package (typosquatting, hijacked maintainer, malicious postinstall). Use npm ci, pin versions, review new deps, consider --ignore-scripts.
  • npm install vs npm ci? → ci installs exactly from the lockfile and fails if it doesn't match. Use it in CI and Docker.

16 — Business Logic

Q: Give an example of a business logic vulnerability.

Answer: Applying the same coupon twice by sending two requests at the same time (race condition), or a negative quantity giving a refund.

Counter questions:

  • How do you fix the double-spend race condition? → Atomic DB operation (UPDATE ... SET balance = balance - ? WHERE balance >= ?), row lock (SELECT ... FOR UPDATE), unique constraint, or a distributed lock (Redlock).
  • How do you make a payment API safe to retry? → Idempotency key: client sends a unique key; server stores the result and returns it for repeats.
  • Why not use floats for money? → 0.1 + 0.2 !== 0.3. Store integers (paise/cents) or use decimal.js.
  • Can a scanner find these bugs? → Rarely. They need threat modeling, tests, and human review.

17 — Infrastructure and Docker

Q: How do you secure a Docker container?

Answer: Small base image (alpine/distroless), run as non-root user, multi-stage build, no secrets in the image, scan with Trivy, read-only filesystem where possible.

Counter questions:

  • Why not run as root inside the container? → Container escape bugs give root on the host. Non-root limits damage.
  • We pass secrets with ARG/ENV in the Dockerfile. Problem? → They stay in image layers and docker history. Use runtime secrets or BuildKit --secret.
  • What is least privilege in the cloud? → Each service gets an IAM role with only the permissions it needs. No shared admin keys.

18 — Security Testing

Q: SAST vs DAST vs SCA?

Answer: SAST scans source code (Semgrep, CodeQL). DAST attacks the running app (ZAP, Burp). SCA checks dependencies (npm audit, Snyk).

Counter questions:

  • Which finds more false positives? → SAST, because it lacks runtime context. DAST has fewer but misses code paths it never reaches.
  • What is threat modeling and when do you do it? → At design time. STRIDE: Spoofing, Tampering, Repudiation, Information disclosure, DoS, Elevation of privilege.
  • How do you test for IDOR automatically? → Integration tests with two users: user A requests user B's resource, expect 404/403.

Scenario questions (open ended)

Q: Design a secure "forgot password" flow.

Answer: Same response whether the email exists or not → random token (crypto.randomBytes), store hash, 15–30 min expiry, single use → link over HTTPS → on reset: hash new password, invalidate all sessions, send "password changed" email. Rate limit the endpoint.

Counter questions:

  • Why store the token hashed? → A DB leak would otherwise let attackers reset any account.
  • The reset link uses the Host header to build the URL. Issue? → Host header injection: attacker sets Host: evil.com, the victim gets a link to the attacker's site. Use a configured base URL.
  • Should the user be logged in automatically after reset? → Many do, but safer is to make them log in (and pass MFA).

Q: Your API is getting slow and you see thousands of login attempts. What do you do?

Answer: Confirm with logs/metrics → block at WAF/CDN → tighten rate limits per IP and per account → add CAPTCHA after failures → check if any accounts were compromised (successful logins from new IPs) → force resets and alert users if so.

Counter questions:

  • How do you know whether any attempt succeeded? → Look for successful logins from the same IPs/ASNs or unusual patterns, new device logins.
  • What do you do afterwards? → Post-mortem, add alerts for that pattern, breached-password checks, push MFA.

Q: You found a SQL injection in production. Walk me through it.

Answer: Don't panic-fix silently. Patch with parameterized queries → deploy → check logs for exploitation → if data was accessed: rotate credentials, assess impact, follow incident and disclosure process → add a test and a SAST rule so it can't come back.

Counter questions:

  • Do you tell users? → If personal data was exposed, yes; laws like GDPR / India's DPDP Act require notifying regulators and users within set deadlines.
  • How do you find other places with the same bug? → Grep / Semgrep for the same pattern across the codebase.

Q: A user reports they can see another user's orders by changing the ID in the URL. What do you do?

Answer: Reproduce it → hotfix with an ownership check (WHERE id = ? AND user_id = ?) → search logs for IDs requested by users who don't own them → check every other endpoint that takes an ID → add a two-user IDOR test to CI.

Counter questions:

  • The ID is a UUID. Can you skip the fix? → No. UUIDs leak in URLs, emails and logs; the ownership check is still needed.
  • How would you stop this whole class of bug, not just this one endpoint? → Central policy layer (e.g. CASL), scope queries by the current user by default, and code review checklists.
  • The user who reported it was poking around. Do you ban them? → No. Thank them, and set up a responsible disclosure policy / security.txt.

Q: Your AWS access key was found in a public GitHub repo. What are your first 30 minutes?

Answer: 1) Deactivate/rotate the key immediately. 2) Check CloudTrail for what that key did (new IAM users, EC2 instances for crypto mining, S3 reads). 3) Remove any resources or users the attacker created. 4) Clean git history. 5) Add gitleaks + push protection.

Counter questions:

  • Why rotate before cleaning the git history? → Bots scrape GitHub within seconds; the key is already copied. History cleanup doesn't un-leak it.
  • CloudTrail shows the attacker created a new IAM user. Now what? → Delete it, its keys, and any roles/policies it added; assume persistence and check every region.
  • How do you avoid long-lived keys entirely? → IAM roles for services, OIDC for CI (GitHub Actions → AWS), SSO for humans.

Q: Product wants "Login with Google" added. What security points do you raise?

Answer: Use Authorization Code flow with PKCE, validate state (CSRF) and nonce, verify the ID token signature, iss, aud and exp, use exact redirect URI matching, and link accounts by the provider's sub, not by email alone.

Counter questions:

  • Why not link accounts by email? → If the provider doesn't verify emails, an attacker signs up with the victim's email and takes over the account. Check email_verified at minimum.
  • Why not the implicit flow? → Tokens are returned in the URL fragment and leak through history and referrers. It's deprecated; use code + PKCE.
  • What does the state parameter protect against? → Login CSRF: the attacker logs the victim into the attacker's account.

Q: A webhook endpoint (e.g. Razorpay/Stripe payment success) marks orders as paid. How do you secure it?

Answer: Verify the HMAC signature on the raw body with timingSafeEqual, reject old timestamps (replay), make processing idempotent by event ID, and re-check the amount and order with the provider's API before marking paid.

Counter questions:

  • Why the raw body and not the parsed JSON? → Re-serializing JSON changes bytes (spacing, key order), so the signature won't match, or worse, you verify something different from what was signed.
  • The same event arrives three times. What happens? → Store processed event IDs with a unique constraint; ignore repeats.
  • Can you just allowlist the provider's IPs instead? → An extra layer at best. IPs change and can be shared; the signature is the real check.

Q: Users can enter a URL and your server generates a link preview. What could go wrong?

Answer: SSRF. The attacker enters http://169.254.169.254/latest/meta-data/ or an internal admin URL. Fix: allow only http/https, resolve and block private/link-local IPs, pin the checked IP for the connection, disable or re-check redirects, set timeouts and a max response size, and run the fetcher in an isolated network.

Counter questions:

  • The URL is http://my-site.attacker.com which resolves to 10.0.0.5. Caught? → Only if you check the resolved IP, not the hostname string.
  • What if the response is a 5 GB file? → Stream with a size limit and timeout, or the fetcher becomes a DoS vector.

Q: An admin panel is deployed at /admin. How would you protect it?

Answer: Strong auth + mandatory MFA, role check on every admin API (not just the UI), restrict by network (VPN / IP allowlist / separate internal domain), audit log every admin action, short session timeout, re-auth for dangerous actions.

Counter questions:

  • Isn't hiding it at /secret-admin-xyz enough? → Security by obscurity. Paths leak through JS bundles, logs and scanners.
  • An admin's laptop is stolen with an active session. Mitigation? → Short idle timeout, ability to revoke all sessions, device binding, step-up auth for critical actions.

Q: You need to build a public API for third-party developers. What security do you design in?

Answer: API keys (hashed in DB, shown once, scoped, rotatable) or OAuth client credentials, per-key rate limits and quotas, strict input validation, pagination limits, no internal IDs or fields leaked, versioning, and usage logging per key.

Counter questions:

  • Why hash API keys if they are random? → A DB leak would otherwise expose every customer's working key. Store a prefix in plain text so users can identify the key.
  • A customer's key leaked. How do they recover without downtime? → Allow two active keys at once: create new, switch, revoke old.
  • A client requests ?limit=1000000. What happens? → Cap it server side (e.g. max 100) or the DB and memory get hammered.

Q: A coupon "FIRST50" is meant for one use per user, but some users used it 10 times. How?

Answer: Race condition: parallel requests all pass the "already used?" check before any of them writes. Fix with a unique constraint on (user_id, coupon_id), or an atomic conditional update / row lock inside a transaction.

Counter questions:

  • Wouldn't a check in Redis fix it? → Only if it's atomic (SET NX) — a separate GET-then-SET has the same race.
  • How would you test for this? → Fire 20 concurrent requests in a test (Promise.all) and assert only one succeeds.
  • What about users making new accounts for more coupons? → Business-level controls: phone/payment-method verification, device fingerprint, fraud rules.

Q: Your app lets users upload a profile picture. A pentester got XSS through it. How?

Answer: Likely an SVG with <script>, or an HTML file renamed to .jpg served with a sniffable/wrong Content-Type from your main domain. Fix: check magic bytes, re-encode images with sharp, reject SVG (or sanitize it), set nosniff, and serve user files from a separate domain/CDN.

Counter questions:

  • Why does a separate domain help? → Script running there can't read your main domain's cookies or call your API as the user (same-origin policy).
  • What does Content-Disposition: attachment change? → The browser downloads the file instead of rendering it.

Q: The security team says your JWT secret is secret123. What's the risk and the fix?

Answer: HS256 with a weak secret can be cracked offline from any token (hashcat). The attacker then signs tokens as any user, including admin. Fix: rotate to a 256-bit random secret or move to RS256/EdDSA keys from a KMS, support key IDs (kid) for rotation, and force re-login.

Counter questions:

  • How do you rotate without logging everyone out? → Publish the new key with a new kid, sign with the new one, keep verifying the old one until old tokens expire.
  • Could an attacker use the kid header against you? → Yes, if you use it in a file path or SQL query to look up the key. Treat it as untrusted input and only match known IDs.

Q: A microservice architecture: service A calls service B internally. Do you need auth between them?

Answer: Yes (zero trust). An SSRF or one compromised service would otherwise reach everything. Use mTLS (service mesh) or signed short-lived service tokens, plus network policies so only A can reach B.

Counter questions:

  • Should service B trust the userId that A sends in a header? → Only if A's identity is verified and A is allowed to act on behalf of users; better to pass the user's signed token down.
  • What's the downside of mTLS everywhere? → Certificate management and rotation; a service mesh (Istio, Linkerd) automates it.

Q: You're the only backend dev and you have one week to secure an existing app before launch. What do you prioritize?

Answer: Highest risk for least effort first: 1) authz/IDOR checks on every endpoint, 2) parameterized queries, 3) secrets out of code and rotated, 4) helmet, CORS allowlist, HTTPS, 5) rate limit login/OTP, 6) npm audit fix critical, 7) generic error responses, 8) backups and logging.

Counter questions:

  • Why authorization before everything else? → Broken access control is #1 in OWASP Top 10 and the most common real breach.
  • What would you postpone? → Pentest, WAF tuning, full SAST pipeline, field-level encryption — plan them for after launch.

Quick fire (one-line answers)

QuestionAnswer
401 vs 403?401 = not authenticated, 403 = authenticated but not allowed
Why HTTPS if data isn't secret?Integrity: stops tampering and script injection on the wire
What is a salt?Random per-user value hashed with the password; stops rainbow tables
What is OWASP Top 10?List of the most critical web app risks, updated every few years
What is defense in depth?Many layers, so one failure doesn't mean a breach
What is principle of least privilege?Give only the access needed, nothing more
Is base64 encryption?No, it's encoding; anyone can decode it
Why crypto.timingSafeEqual?Normal === leaks how many chars matched via timing
What's clickjacking?Your page in an invisible iframe; fix with frame-ancestors 'none'
Why is eval dangerous?Runs any string as code; user input → remote code execution