50 Web Development MCQs with Answers

50 Web Development MCQs with Answers

Looking to test or sharpen your web development knowledge? This collection of 50 multiple-choice questions covers essential front-end and back-end concepts, common tools, and practical scenarios which is ideal for students, interview prep, and quick self-assessments.

Each question includes a clear answer so you can learn as you go. Use this set to identify gaps, reinforce fundamentals, and quickly boost confidence before interviews or exams.

1. What does HTML stand for?

A) Hyper Trainer Marking Language
B) Hyper Text Markup Language
C) Hyper Text Marketing Language
D) Hyper Tool Multi Language

Correct Answer: B) Hyper Text Markup Language

2. Which semantic tag is used for navigation links?

A) <div>
B) <nav>
C) <section>
D) <aside>

Correct Answer: B) <nav>

3. Which input type is used for email validation?

A) text
B) mail
C) email
D) validation

Correct Answer: C) email

4. Which feature was introduced in HTML5?

A) Frameset
B) Local Storage
C) Font tag
D) Center tag

Correct Answer: B) Local Storage

5. Which tag improves SEO structure?

A) <font>
B) <center>
C) <article>
D) <blink>

Correct Answer: C) <article>

6. Which selector has the highest specificity?

A) Element selector
B) Class selector
C) ID selector
D) Universal selector

Correct Answer: C) ID selector

7. The CSS box model includes:

A) Margin, Border, Padding, Content
B) Header, Body, Footer
C) Grid, Flexbox, Float
D) Position, Display, Visibility

Correct Answer: A) Margin, Border, Padding, Content

8. Which CSS layout is best for one-dimensional layouts?

A) Grid
B) Flexbox
C) Float
D) Table

Correct Answer: B) Flexbox

9. Which CSS system is designed for two-dimensional layouts?

A) Float
B) Inline-block
C) Grid
D) Positioning

Correct Answer: C) Grid

10. Media queries are mainly used for:

A) Database connection
B) Responsive design
C) SEO optimization
D) Image compression

Correct Answer: B) Responsive design

11. Which keyword creates a block-scoped variable?

A) var
B) global
C) let
D) define

Correct Answer: C) let

12. What is the type of `null` in JavaScript?

A) null
B) object
C) undefined
D) boolean

Correct Answer: B) object

13. Which method selects an element by ID?

A) querySelectorAll()
B) getElementById()
C) getElementsByClass()
D) selectElement()

Correct Answer: B) getElementById()

14. Which event occurs when a user clicks an element?

A) onhover
B) onchange
C) onclick
D) onmouse

Correct Answer: C) onclick

15. Arrow functions were introduced in:

A) ES5
B) ES6
C) ES3
D) ES4

Correct Answer: B) ES6

16. Closures allow functions to:

A) Access outer scope variables
B) Create databases
C) Stop execution
D) Render HTML

Correct Answer: A) Access outer scope variables

17. Hoisting in JavaScript means:

A) Moving variables to another file
B) Variables/functions moved to top during compilation
C) Deleting unused variables
D) Encrypting variables

Correct Answer: B) Variables/functions moved to top during compilation

18. Promises are mainly used for:

A) Styling
B) Asynchronous operations
C) Database indexing
D) SEO

Correct Answer: B) Asynchronous operations

19. Which keyword waits for a Promise to resolve?

A) wait
B) async
C) await
D) resolve

Correct Answer: C) await

20. Which is an ES6 feature?

A) var
B) XML
C) Template literals
D) Frames

Correct Answer: C) Template literals

21. In React, data passed to components are called:

A) Hooks
B) States
C) Props
D) Events

Correct Answer: C) Props

22. Vue computed properties are:

A) Static values
B) Cached reactive values
C) HTML elements
D) API endpoints

Correct Answer: B) Cached reactive values

23. Angular services are mainly used for:

A) Styling
B) Data sharing and logic
C) Animations
D) SEO

Correct Answer: B) Data sharing and logic

24. Component lifecycle methods help to:

A) Design UI
B) Track component stages
C) Create databases
D) Deploy apps

Correct Answer: B) Track component stages

25. Conditional rendering means:

A) Rendering based on conditions
B) Loading CSS
C) Database filtering
D) Image optimization

Correct Answer: A) Rendering based on conditions

26. Node.js is built on:

A) SpiderMonkey
B) V8 Engine
C) Java VM
D) PHP Engine

Correct Answer: B) V8 Engine

27. Express.js is mainly used for:

A) Database management
B) Backend web applications
C) CSS styling
D) Machine learning

Correct Answer: B) Backend web applications

28. Middleware functions in Express:

A) Handle requests between client and server
B) Style components
C) Create animations
D) Compress images

Correct Answer: A) Handle requests between client and server

29. REST APIs commonly use:

A) HTTP methods
B) CSS selectors
C) SQL joins
D) XML tags

Correct Answer: A) HTTP methods

30. Which status code indicates server error?

A) 200
B) 301
C) 404
D) 500

Correct Answer: D) 500

31. SQL databases are:

A) Relational
B) Non-relational
C) Graph-based only
D) Cache systems

Correct Answer: A) Relational

32. MongoDB stores data in:

A) Tables
B) Rows
C) Documents
D) Sheets

Correct Answer: C) Documents

33. CRUD stands for:

A) Create, Read, Update, Delete
B) Copy, Remove, Upload, Download
C) Create, Run, Undo, Deploy
D) Control, Read, Use, Delete

Correct Answer: A) Create, Read, Update, Delete

34. Database indexes improve:

A) Security
B) Query performance
C) Styling
D) Deployment

Correct Answer: B) Query performance

35. Foreign keys help maintain:

A) Authentication
B) Relationships between tables
C) CSS layout
D) API routing

Correct Answer: B) Relationships between tables

36. LocalStorage data persists:

A) Only during session
B) Permanently until cleared
C) For one minute
D) Only online

Correct Answer: B) Permanently until cleared

37. JWT stands for:

A) Java Web Token
B) JSON Web Token
C) JavaScript Web Transfer
D) JSON Wireless Transfer

Correct Answer: B) JSON Web Token

38. HTTPS provides:

A) Styling
B) Encryption and security
C) Database indexing
D) Faster images

Correct Answer: B) Encryption and security

39. CORS stands for:

A) Cross-Origin Resource Sharing
B) Create Object Rendering System
C) Client-Origin Response Service
D) Cross Output Resource Sharing

Correct Answer: A) Cross-Origin Resource Sharing

40. XSS attacks inject:

A) CSS files
B) SQL queries
C) Malicious scripts
D) APIs

Correct Answer: C) Malicious scripts

41. GraphQL allows:

A) Fixed responses only
B) Flexible data querying
C) CSS rendering
D) Database encryption

Correct Answer: B) Flexible data querying

42. Fetch API is used for:

A) Database creation
B) HTTP requests
C) Image editing
D) CSS animations

Correct Answer: B) HTTP requests

43. Axios is a:

A) CSS library
B) HTTP client
C) Database engine
D) HTML parser

Correct Answer: B) HTTP client

44. Which HTTP status code means “Not Found”?

A) 200
B) 201
C) 404
D) 500

Correct Answer: C) 404

45. JSON stands for:

A) Java Source Object Notation
B) JavaScript Object Notation
C) Java Syntax Object Network
D) JavaScript Online Notation

Correct Answer: B) JavaScript Object Notation

46. Git is mainly used for:

A) Styling
B) Version control
C) Image editing
D) Hosting

Correct Answer: B) Version control

47. CI/CD stands for:

A) Continuous Integration / Continuous Deployment
B) Code Integration / Code Design
C) Continuous Internet / Continuous Database
D) Code Inspection / Code Delivery

Correct Answer: A) Continuous Integration / Continuous Deployment

48. Docker is primarily used for:

A) Animation
B) Containerization
C) Database indexing
D) SEO

Correct Answer: B) Containerization

49. Which platform is commonly used for frontend deployment?

A) MySQL
B) Netlify
C) MongoDB
D) Express.js

Correct Answer: B) Netlify

50. Environment variables are commonly stored in:

A) app.css
B) index.html
C) .env file
D) package-lock.json

Correct Answer: C) .env file