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
61 practiced

You are given a simple PHP login snippet:

php
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
$result = mysql_query($query);

Identify every vulnerability present, map each to its OWASP/CWE entry, and propose immediate code fixes for all of them (parameterized queries, hashed password comparison, and the deprecated mysql_* API).

HardSystem Design
41 practiced

Design an approach to secure serverless (AWS Lambda) functions that process external input. As a penetration tester, list common serverless-specific vulnerabilities (e.g., excessive permissions, insecure environment variables, event-data injection), how you would test for them, and recommend secure deployment patterns and IAM best practices.

EasyTechnical
36 practiced

List and explain the most important cookie and session flags and properties to check when testing session management: HttpOnly, Secure, SameSite, session-ID entropy and rotation on login, and appropriate expiration. Explain what an attacker gains if each protection is missing.

MediumTechnical
40 practiced

A shopping-cart endpoint applies discounts via a JSON payload with fields itemId and discount. You suspect a business-logic flaw allows stacking discounts across users. Design tests to discover this class of business-logic abuse, describe a proof of concept that demonstrates the financial impact, and explain how you would report it responsibly to developers and product owners.

MediumTechnical
35 practiced

Explain how you would detect and exploit insecure direct file inclusion or path traversal in a web app. Provide a step-by-step testing methodology (including bypass techniques such as null bytes or encoded slashes where applicable), the safety precautions you would take while testing, and the remediation advice you would give developers.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.