Security / SQL Injection Interview Questions 2026

Published July 22, 2026 · Updated July 22, 2026

32 Security / SQL Injection interview questions from General, TCS, Amazon, Razorpay, Stripe, Salesforce and more. Real questions from Technical, System Design, and HR rounds.

32 questions
Companies: General, TCS, Amazon, Razorpay…

All Security / SQL Injection Questions

Amazon Hard Scenario round 4-8 years

A rate limiting mechanism blocks requests after 100/minute. An attacker sends 99 requests/minute from 1000 different IPs. Your rate limiter doesn't catch this. What type of attack is this and how do you mitigate it?

↑ 79 upvotes · 7 engineers asked this · SDE2
General Medium Screening round 2-6 years

How do you securely store API keys that your application needs to call third-party services? Compare 4 approaches.

↑ 78 upvotes · 6 engineers asked this · SDE2
Amazon Hard Screening round 3-6 years

Explain how OAuth 2.0 authorization code flow works. Why is it more secure than the implicit flow?

↑ 78 upvotes · 6 engineers asked this · SDE2
General Hard Scenario round 3-7 years

You find a log file containing plaintext credit card numbers. What immediate steps do you take and in what order?

↑ 77 upvotes · 5 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

Explain CORS. A developer disables CORS entirely with Access-Control-Allow-Origin: * on your API. Why is this a security risk for some endpoints?

↑ 76 upvotes · 4 engineers asked this · SDE2
General Medium Screening round 2-5 years

Your API returns user data based on a user ID in the URL: GET /api/users/123/profile. A user changes 123 to 124 and sees someone else's profile. What vulnerability is this and how do you fix it?

↑ 75 upvotes · 3 engineers asked this · SDE2
TCS Medium Screening round 1-4 years

Explain what HTTPS does and does NOT protect against.

↑ 74 upvotes · 42 engineers asked this · SDE2
Amazon Hard Screening round 3-7 years

What is a timing attack and how do you prevent it in a password comparison function?

↑ 73 upvotes · 41 engineers asked this · SDE2
TCS Medium Scenario round 2-5 years

Your application logs show someone is trying thousands of username/password combinations per second. How do you stop this?

↑ 72 upvotes · 40 engineers asked this · SDE2
TCS Medium Technical round 2-5 years

A user reports they can see another user's data by changing the ID in the URL: /api/orders/123 → /api/orders/124. What vulnerability is this?

↑ 71 upvotes · 39 engineers asked this · SDE2
Razorpay Hard Scenario round 4-7 years

Your JWT tokens are being stolen from localStorage and used in attacks. A developer suggests using httpOnly cookies instead. Describe the complete migration, including risks and security tradeoffs.

↑ 70 upvotes · 18 engineers asked this · SDE2
TCS Hard Screening round 3-7 years

Explain OWASP Top 10 in 2023. Pick 3 and explain how to defend against them with code examples.

↑ 70 upvotes · 38 engineers asked this · SDE2
Amazon Hard Technical round 3-6 years

You discover a reflected XSS vulnerability in your React application despite React's automatic escaping. How is this possible in React?

↑ 69 upvotes · 17 engineers asked this · SDE2
TCS Hard Screening round 2-5 years

Your company stores user passwords as MD5 hashes. A developer says 'MD5 is fine because we also add a salt.' Is he right? Explain the actual risk and the correct solution.

↑ 68 upvotes · 16 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

Your API returns different error messages for valid vs invalid usernames during login (e.g., 'Wrong password' vs 'User not found'). Why is this a security vulnerability and how do you fix it?

↑ 67 upvotes · 15 engineers asked this · SDE2
General Hard Technical round 3-7 years

A security audit finds that your Node.js API is vulnerable to SQL injection despite using parameterized queries everywhere. How is this possible?

↑ 66 upvotes · 14 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

What is the difference between authentication and authorization? Give examples of getting each wrong.

↑ 63 upvotes · 11 engineers asked this · SDE2
Stripe Hard Technical round 3-7 yearsSecuritySystem DesignSQL

Explain idempotency keys in a payments API. What specific failure mode do they prevent, and how would you design the storage layer for them so they don't become a bottleneck?

↑ 40 upvotes · 20 engineers asked this · Senior SDE
General Hard Scenario round 3-7 years

A user says they can log in to your app as another user by changing a value in their session cookie. How serious is this and what's your immediate response?

↑ 33 upvotes · 21 engineers asked this · SDE2
Amazon Hard Screening round 3-6 years

Explain the difference between OAuth 2.0 and OpenID Connect (OIDC). Which one should you use for login?

↑ 27 upvotes · 5 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

How do you prevent clickjacking and what is the X-Frame-Options header?

↑ 26 upvotes · 34 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

What is the difference between symmetric and asymmetric encryption? When would you use each in a web application?

↑ 25 upvotes · 33 engineers asked this · SDE2
Stripe Medium Technical round 3-6 yearsSecurity

How would you design API key storage so that even if your database is breached, attackers can't use the leaked keys directly?

↑ 25 upvotes · 14 engineers asked this · Senior SDE
Amazon Hard Screening round 3-7 years

What is SSRF (Server-Side Request Forgery) and give a real-world example of how it's exploited.

↑ 24 upvotes · 32 engineers asked this · SDE2
Salesforce Medium Technical round 3-6 yearsSecurity

Explain the difference between role-based access control (RBAC) and attribute-based access control (ABAC). Give an example permission requirement that RBAC alone can't express cleanly.

↑ 24 upvotes · 11 engineers asked this · Senior SDE
Amazon Hard Screening round 3-6 years

Explain content security policy (CSP). How does it protect against XSS?

↑ 23 upvotes · 31 engineers asked this · SDE2
TCS Medium Scenario round 1-4 years

What is SQL injection and how do you prevent it in a Python Flask app that takes user search input?

↑ 22 upvotes · 30 engineers asked this · SDE2
Salesforce Hard Technical round 4-8 yearsSecurity

In a shared-schema multi-tenant database, what specific bug pattern most commonly causes cross-tenant data leaks, and how do you prevent it at the code level, not just by convention?

↑ 22 upvotes · 10 engineers asked this · Senior SDE
Amazon Hard Scenario round 3-8 years

A customer calls support at 2 AM. They say they can see another customer's order history when they click 'My Orders.' You're on call. Walk me through your incident response.

↑ 20 upvotes · 8 engineers asked this · SDE2
General Hard HR round 2-6 years

You join a company and find the main API has no authentication on 3 endpoints that return user PII. Your manager says 'it's legacy, we'll fix it later.' What do you do?

↑ 19 upvotes · 7 engineers asked this · SDE2
General Hard Scenario round 2-7 years

A junior developer on your team committed an API key to a public GitHub repository 3 days ago. What do you do?

↑ 11 upvotes · 19 engineers asked this · SDE2
Amazon Medium Screening round 2-5 years

What is the difference between authentication with sessions vs JWT? Security trade-offs?

↑ 8 upvotes · 16 engineers asked this · SDE2

Practice these questions with AI feedback

Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.

Build my study plan →

Same topic at specific companies

General Security / SQL Injection TCS Security / SQL Injection Amazon Security / SQL Injection Razorpay Security / SQL Injection Stripe Security / SQL Injection Salesforce Security / SQL Injection

Related topics

DSA / Arrays System Design DSA / Trees DSA / Graphs Behavioral Testing Domain DevOps API Testing DSA / Hashmaps GCP / Real-time Data Java / Pub-Sub React / Performance Node.js / Memory SQL / Query Optimization Python / Async AWS / Lambda Kafka / Consumer Microservices / Saga Pattern TypeScript / Type System MongoDB / Indexing Performance / Latency Tail Redis / Cache Stampede Elasticsearch / Cluster Health GraphQL / Security Data Engineering / Exactly Once Snowflake / Architecture PySpark / Core Concepts Airflow / Scheduling Web / WebAssembly Debugging / Production JavaScript / V8 Engine

Frequently asked questions

A rate limiting mechanism blocks requests after 100/minute. An attacker sends 99 requests/minute from 1000 different IPs. Your rate limiter doesn't catch this. What type of attack is this and how do you mitigate it?
A rate limiting mechanism blocks requests after 100/minute. An attacker sends 99 requests/minute from 1000 different IPs. Your rate limiter doesn't catch this. What type of attack is this and how do you mitigate it?
How do you securely store API keys that your application needs to call third-party services? Compare 4 approaches.
How do you securely store API keys that your application needs to call third-party services? Compare 4 approaches.
Explain how OAuth 2.0 authorization code flow works. Why is it more secure than the implicit flow?
Explain how OAuth 2.0 authorization code flow works. Why is it more secure than the implicit flow?
You find a log file containing plaintext credit card numbers. What immediate steps do you take and in what order?
You find a log file containing plaintext credit card numbers. What immediate steps do you take and in what order?
Explain CORS. A developer disables CORS entirely with Access-Control-Allow-Origin: * on your API. Why is this a security risk for some endpoints?
Explain CORS. A developer disables CORS entirely with Access-Control-Allow-Origin: * on your API. Why is this a security risk for some endpoints?