TGViewer
Web Development Web Development @webdevcoursefree ยท 79.6K subscribers
Post #3768 2.87K
๐Ÿš€ Web Development Interview Questions with Answers โ€” Part 7: Web Security

๐Ÿง  151. What is HTTPS?

HTTPS stands for: ๐Ÿ‘‰ HyperText Transfer Protocol Secure

It is the secure version of HTTP that encrypts data exchanged between browser and server.

Benefits:

โœ… Secure communication

โœ… Protects sensitive data

โœ… Prevents eavesdropping

Example: https://example.com

๐Ÿง  152. Difference Between HTTP and HTTPS

Feature : HTTP : HTTPS

Security : Not secure : Secure

Data : Sent as plain text : Data encrypted

Port : Uses Port 80 : Uses Port 443

SSL/TLS : No SSL/TLS : Requires SSL/TLS

๐Ÿง  153. What is SSL/TLS?

SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are protocols that encrypt data transmission.

Benefits:

โœ… Data encryption

โœ… Authentication

โœ… Data integrity

Example: When you see a padlock icon in the browser, SSL/TLS is being used.

๐Ÿง  154. What is XSS Attack?

XSS stands for: ๐Ÿ‘‰ Cross-Site Scripting

It occurs when attackers inject malicious JavaScript into webpages.

Example:

<script>
alert("Hacked");
</script>


Prevention:

โœ… Validate input

โœ… Escape output

โœ… Use Content Security Policy (CSP)

๐Ÿง  155. What is CSRF Attack?

CSRF stands for: ๐Ÿ‘‰ Cross-Site Request Forgery

It tricks authenticated users into performing unwanted actions.

Example: A logged-in user unknowingly submits a bank transfer request.

Prevention:

โœ… CSRF Tokens

โœ… SameSite Cookies

โœ… Authentication checks

๐Ÿง  156. What is SQL Injection?

SQL Injection occurs when malicious SQL code is inserted into queries.

Vulnerable Query:

SELECT * FROM users
WHERE username = 'admin'
AND password = '123';


Prevention:

โœ… Prepared Statements

โœ… Parameterized Queries

โœ… Input Validation

๐Ÿง  157. How to Secure APIs?

Best Practices:

โœ… Use HTTPS

โœ… Authentication & Authorization

โœ… Rate Limiting

โœ… Input Validation

โœ… API Keys

โœ… JWT Tokens

Example: Authorization: Bearer <token>

๐Ÿง  158. What is Hashing?

Hashing converts data into a fixed-length value.

Example:

password123  
โ†“
5e884898da...


Uses: Password storage, Data verification

๐Ÿง  159. Difference Between Encryption and Hashing

Feature : Encryption : Hashing

Reversibility : Reversible : Irreversible

Key : Uses key : No key required

Purpose : Protects data : Verifies integrity

Example:

Encryption โ†’ Credit card data

Hashing โ†’ Passwords

๐Ÿง  160. What is bcrypt?

bcrypt is a password hashing algorithm.

Features:

โœ… Salt generation

โœ… Secure password storage

โœ… Resistant to brute-force attacks

Example:

const hash = await bcrypt.hash(password, 10);


๐Ÿง  161. What is OAuth?

OAuth is an authorization framework that allows third-party applications to access resources without sharing passwords.

Examples: Login with Google, Login with GitHub, Login with Facebook

Benefits:

โœ… Secure authentication

โœ… No password sharing

๐Ÿง  162. What is JWT Token Security?

JWT (JSON Web Token) securely transmits user information.

Structure: Header.Payload.Signature

Security Tips:

โœ… Short expiration time

โœ… Use HTTPS

โœ… Store securely

๐Ÿง  163. What is Content Security Policy (CSP)?

CSP is a browser security feature that helps prevent XSS attacks.

Example:

Content-Security-Policy: default-src 'self';
  • โค 6
More from @webdevcoursefree
  1. Oct 12, 2026For example: Go to Profile โ†’ <a> Submit Form โ†’ <button> Open Article โ†’ <a> Delete Accountโ€ฆ
  2. Oct 12, 2026๐ŸŒ Web Development Roadmap โ€” Part 16 HTML Links โ€” Tag Links are one of the most importantโ€ฆ
  3. Oct 12, 2026๐Ÿš€ ๐—ช๐—ต๐—ถ๐—ฐ๐—ต ๐—ง๐—ฒ๐—ฐ๐—ต ๐—ฆ๐—ธ๐—ถ๐—น๐—น ๐—ช๐—ถ๐—น๐—น ๐—ฌ๐—ผ๐˜‚ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ? Want to builโ€ฆ
  4. Oct 9, 2026Post #4079
  5. Oct 9, 2026Post #4078
  6. Oct 9, 2026Post #4077
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’