InterviewStack.io LogoInterviewStack.io

Secure Coding and Application Security Questions

Writing and reviewing code that resists attack. Covers the OWASP Top Ten and common web vulnerabilities (XSS, SQL injection, CSRF), input validation, secure coding practices and security code review, static application security testing (SAST), API and HTTP security, database and frontend security, and mobile app security. The application-layer defense discipline for engineers building software.

EasyTechnical
40 practiced

Explain the three types of Cross-Site Scripting (stored, reflected, and DOM-based): how each one arises in source code and executes at runtime, how they map to CWE-79, and the concrete mitigations you would apply for each (output encoding, safe templating, Content Security Policy, sanitization libraries).

HardSystem Design
44 practiced

Your web application serves user-generated HTML and relies on third-party analytics and widgets. Design a Content Security Policy that reduces XSS risk while preserving the required third-party functionality. Discuss nonces versus hashes, strict-dynamic, report-only mode, subresource integrity, and practical bypass techniques an attacker might try against your policy.

EasyTechnical
36 practiced

Explain how SQL injection attacks work, covering error-based, union-based, boolean/conditional-blind, and time-based blind techniques with a short example payload for each. Give a real-world exploit example and its business impact, then propose a prioritized set of mitigations at the code, framework, database, and architecture levels (parameterized queries/ORM best practices, least-privileged DB accounts, network rules, WAF, logging and detection).

MediumSystem Design
42 practiced

List and justify the design patterns you would use to secure a public REST API that supports multiple clients. Cover authentication and authorization (OAuth2 scopes), input validation, output filtering, rate limiting, safe pagination/cursor design, field-level encryption for sensitive fields, and how you would separate perimeter (gateway) controls from business-logic-level checks.

EasyTechnical
32 practiced

Why is the guideline 'don't roll your own crypto' so widely recommended? Give three specific pitfalls developers encounter when implementing custom cryptography (for example: weak randomness, incorrect AEAD usage, padding-oracle vulnerabilities), and list the recommended libraries or primitives to use instead for encrypting data at rest and in transit.

Unlock Full Question Bank

Get access to all 42 Secure Coding and Application Security interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.