LearnThatStack Ace your next interview
Topic · part of Security
Secure Coding Practices.
28 Qs 4 free
Change topic Change
Drill · questions

All questions

of 28
Beginner 7
01

What is input validation and why is it crucial for application security?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Input validation is the process of verifying that user-supplied data meets expected criteria before processing it. It's crucial because unvalidated input is the root cause of many security vulnerabilities including injection attacks, buffer overflows, and data corruption.

Key principles:

  • Whitelist validation: Define what is acceptable rather than what isn't
  • Server-side validation: Never rely solely on client-side validation
  • Sanitization: Clean or encode input when validation isn't sufficient
  • Length limits: Prevent buffer overflows and DoS attacks

Example of proper validation:

import re

def validate_email(email):
    pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
    if re.match(pattern, email) and len(email) <= 254:
        return True
    return False
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

02

What's the difference between authentication and authorization?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Authentication verifies "who you are" - confirming the identity of a user or system.

  • Examples: Username/password, biometrics, certificates

Authorization determines "what you can do" - granting or denying access to resources based on identity.

  • Examples: Role-based access control (RBAC), permissions, ACLs

Example flow:

  1. User provides credentials (authentication)
  2. System verifies credentials
  3. System checks user's permissions for requested resource (authorization)
  4. Grant or deny access based on permissions
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

03

What is SQL injection and how can it be prevented?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

SQL injection occurs when user input is directly concatenated into SQL queries, allowing attackers to manipulate the database.

Example of vulnerable code:

# VULNERABLE
query = f"SELECT * FROM users WHERE username = '{username}'"

Attack example: username = "admin'; DROP TABLE users; --"

Prevention methods:

  1. Parameterized queries/Prepared statements (most effective)
  2. Stored procedures (when properly implemented)
  3. Input validation (whitelist approach)
  4. Least privilege principle for database accounts
  5. Web Application Firewalls (additional layer)

Secure example:

# SECURE - Using parameterized query
cursor.execute("SELECT * FROM users WHERE username = %s", (username,))
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

04

What is XSS and what are the three main types?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Cross-Site Scripting (XSS) allows attackers to inject malicious scripts into web pages viewed by other users.

Three main types:

  1. Stored XSS (Persistent): Malicious script stored on server

    • Example: Comment section storing <script>alert('XSS')</script>
  2. Reflected XSS (Non-persistent): Script reflected from request

    • Example: Search parameter displayed without encoding
  3. DOM-based XSS: Vulnerability in client-side JavaScript

    • Example: document.write(location.hash.substring(1))

Impact: Session hijacking, credential theft, defacement, malware distribution

Prevention: Input validation, output encoding, Content Security Policy (CSP), sanitization

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

05

What is CSRF and how can it be prevented?

Part of Pro
06

What's the difference between hashing, encryption, and encoding?

Part of Pro
07

What is the OWASP Top 10 and how does it guide secure development?

Part of Pro
Intermediate 12
08

Explain the difference between input validation, sanitization, and encoding.

Part of Pro
09

What are the security considerations when implementing password-based authentication?

Part of Pro
10

Explain JWT (JSON Web Tokens) and their security implications.

Part of Pro
11

What are the different types of SQL injection attacks?

Part of Pro
12

How do you prevent XSS attacks in web applications?

Part of Pro
13

Explain the different CSRF token implementation patterns.

Part of Pro
14

What are the security best practices for session management?

Part of Pro
15

What are the key principles of secure cryptographic implementation?

Part of Pro
16

How should applications handle errors securely?

Part of Pro
17

What are the key security considerations for REST API design?

Part of Pro
18

What are the security risks associated with file uploads and how do you mitigate them?

Part of Pro
19

Explain the principle of least privilege and how to implement it.

Part of Pro
Expert 9
20

What are some common input validation bypass techniques that attackers use?

Part of Pro
21

How do prepared statements prevent SQL injection, and what are their limitations?

Part of Pro
22

What is Content Security Policy (CSP) and how does it help prevent XSS?

Part of Pro
23

What is session fixation and how do you prevent it?

Part of Pro
24

Explain the security considerations when implementing HTTPS/TLS.

Part of Pro
25

What are the security considerations for application logging?

Part of Pro
26

How do you implement secure API rate limiting?

Part of Pro
27

What are the security implications of poor memory management in applications?

Part of Pro
28

What is defense in depth and how do you implement it in web applications?

Part of Pro

No matches

Try a different filter or search term.

Pro · $10/mo

24 of 28 Secure Coding Practices answers are gated.

Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.

  • Full answers + code
  • AI explain - simpler, deeper, or visualized
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

JAM

JavaScript, APIs, and Markup

Serverless on AWS

Serverless Architecture on AWS

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Flutter Mobile

Flutter Cross-Platform Mobile Development

Cross-cutting topics 44 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

Web3 / Ethereum

Solidity, Ethereum, Hardhat, Foundry

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git
Big-O & Complexity Analysis Arrays, Strings & Hash Tables Linked Lists, Stacks & Queues Trees, BSTs & Heaps Graphs Sorting, Searching & Recursion Operating Systems Concurrency & Multithreading Networking for Developers Git & Version Control API Design 45 Distributed Systems Fundamentals 34

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.


Cross-cutting topics 45 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.