Web Technologies MCQs with answers are essential for computer science students, frontend/backend developers, and competitive exam preparation (PPSC, FPSC, NTS). If you are looking for reliable Web Technologies MCQs, this comprehensive set of Web Technologies MCQs covers HTML5, CSS3, JavaScript, HTTP status codes, JSON, and REST APIs. Mastering these Web Technologies MCQs helps build core web development skills and achieve high test scores in every exam.
Table of Contents
Part 1: Web Technologies MCQs
Question 1: Which HTML5 element is used for navigation links?
- A)
<header> - B)
<nav> - C)
<section> - D)
<aside>
Correct Answer: B)
<nav>
Question 2: Which CSS3 property creates 1D responsive flexible layouts?
- A) Display: Grid
- B) Display: Flex
- C) Position: Absolute
- D) Float: Left
Correct Answer: B) Display: Flex
Note: Learn more foundational concepts by practicing more Web Technologies MCQs alongside our guide on Data Mining & Data Warehousing MCQs.
Question 3: Which JS keyword creates a block-scoped re-assignable variable?
- A) var
- B) const
- C) let
- D) static
Correct Answer: C) let
Question 4: What represents HTML elements as an object tree for JS manipulation?
- A) Cookies
- B) DOM
- C) Engine
- D) Sockets
Correct Answer: B) DOM
Question 5: Which CSS property controls element stacking order along Z-axis?
- A) order
- B) z-index
- C) position
- D) display
Correct Answer: B) z-index
Question 6: Which HTML attribute makes a field mandatory before form submit?
- A) validate
- B) required
- C) important
- D) mandatory
Correct Answer: B) required
Question 7: Which CSS layout module provides a 2D grid-based structure?
- A) Flexbox
- B) CSS Grid
- C) Box Model
- D) Columns
Correct Answer: B) CSS Grid
Question 8: Which JavaScript function parses a JSON string into an object?
- A) JSON.stringify()
- B) JSON.parse()
- C) JSON.toObject()
- D) JSON.convert()
Correct Answer: B) JSON.parse()
Question 9: What handles asynchronous execution in JavaScript without blocking UI?
- A) Event Loop
- B) Call Stack
- C) Garbage Collector
- D) Web Worker
Correct Answer: A) Event Loop
Question 10: Which HTML5 tag embeds vector graphics directly in web pages?
- A)
<canvas> - B)
<svg> - C)
<img> - D)
<picture>
Correct Answer: B)
<svg>
Question 11: Which legacy object handled AJAX requests before Fetch API?
- A) FetchObject
- B) XMLHttpRequest
- C) HttpStream
- D) Axios
Correct Answer: B) XMLHttpRequest
Question 12: Which CSS unit is relative to the root <html> font size?
- A) em
- B) rem
- C) px
- D) vh
Correct Answer: B) rem
Question 13: Which method attaches an event handler to an HTML element in JS?
- A) attachEvent()
- B) addEventListener()
- C) listenEvent()
- D) bindEvent()
Correct Answer: B) addEventListener()
Question 14: Which Web Storage API persists data with no expiration time?
- A) sessionStorage
- B) localStorage
- C) Cookies
- D) IndexedDB
Correct Answer: B) localStorage
Question 15: Which CSS pseudo-class selects an element on mouse hover?
- A) :active
- B) :hover
- C) :focus
- D) :visited
Correct Answer: B) :hover
Question 16: What is the default display value for <div> elements?
- A) inline
- B) block
- C) inline-block
- D) flex
Correct Answer: B) block
Question 17: Which JS array method returns a filtered array based on a condition?
- A) map()
- B) filter()
- C) reduce()
- D) forEach()
Correct Answer: B) filter()
Question 18: Which protocol secures web traffic using TLS/SSL encryption?
- A) HTTP
- B) HTTPS
- C) FTP
- D) SSH
Correct Answer: B) HTTPS
Question 19: What JS feature gives inner functions access to outer scope variables?
- A) Callback
- B) Closure
- C) Promise
- D) Generator
Correct Answer: B) Closure
Question 20: Which script attribute downloads JS asynchronously while parsing HTML?
- A) defer
- B) async
- C) preload
- D) module
Correct Answer: B) async
Question 21: Which browser security restricts cross-domain requests?
- A) CSRF
- B) Same-Origin Policy (SOP)
- C) XSS
- D) CSP
Correct Answer: B) Same-Origin Policy (SOP)
Question 22: Which HTML attribute provides alt text for images?
- A) title
- B) alt
- C) src
- D) description
Correct Answer: B) alt
Question 23: What JS object represents eventual completion of an async operation?
- A) Callback
- B) Promise
- C) Event
- D) Observable
Correct Answer: B) Promise
Question 24: Which HTTP header specifies the payload MIME type?
- A) Accept
- B) Content-Type
- C) Authorization
- D) User-Agent
Correct Answer: B) Content-Type
Question 25: Which CSS property clears floated elements?
- A) display
- B) clear
- C) float
- D) overflow
Correct Answer: B) clear
Part 2: REST APIs MCQs
Question 26: What does REST stand for in web service architecture?
- A) Remote Enterprise Server Transfer
- B) Representational State Transfer
- C) Real-time Execution Socket Transport
- D) Resource State Transmission
Correct Answer: B) Representational State Transfer
Question 27: Which HTTP method replaces an existing resource completely?
- A) POST
- B) PUT
- C) PATCH
- D) GET
Correct Answer: B) PUT
Question 28: Which HTTP method applies partial updates to a resource?
- A) PUT
- B) PATCH
- C) POST
- D) UPDATE
Correct Answer: B) PATCH
Question 29: Which HTTP status code indicates resource creation success?
- A) 200 OK
- B) 201 Created
- C) 204 No Content
- D) 301 Moved Permanently
Correct Answer: B) 201 Created
Question 30: Which HTTP status code represents unauthenticated access?
- A) 400 Bad Request
- B) 401 Unauthorized
- C) 403 Forbidden
- D) 404 Not Found
Correct Answer: B) 401 Unauthorized
Question 31: Which HTTP status code indicates server refusal despite authentication?
- A) 401 Unauthorized
- B) 403 Forbidden
- C) 404 Not Found
- D) 405 Method Not Allowed
Correct Answer: B) 403 Forbidden
Question 32: What term describes methods that yield identical results on repeated calls?
- A) Stateless
- B) Idempotent
- C) Cacheable
- D) Asynchronous
Correct Answer: B) Idempotent
Question 33: Which HTTP method is NOT idempotent in REST design?
- A) GET
- B) POST
- C) PUT
- D) DELETE
Correct Answer: B) POST
Question 34: What data format is most commonly used in REST APIs?
- A) XML
- B) JSON
- C) YAML
- D) HTML
Correct Answer: B) JSON
Question 35: Which header mechanism allows cross-domain browser requests?
- A) CSP
- B) CORS
- C) JWT
- D) HTTPS
Correct Answer: B) CORS
Question 36: Which token format consists of Header, Payload, and Signature?
- A) OAuth 2.0
- B) JWT
- C) API Key
- D) Session Cookie
Correct Answer: B) JWT
Question 37: Which REST rule ensures servers don’t store client session state?
- A) Layered System
- B) Statelessness
- C) Cacheability
- D) Uniform Interface
Correct Answer: B) Statelessness
Question 38: Which HTTP status code represents an Internal Server Error?
- A) 400
- B) 500
- C) 502
- D) 503
Correct Answer: B) 500
Question 39: Which HTTP status code represents a missing resource URL?
- A) 400 Bad Request
- B) 404 Not Found
- C) 408 Request Timeout
- D) 504 Gateway Timeout
Correct Answer: B) 404 Not Found
Question 40: What URL point is accessed by client applications to fetch data?
- A) Payload
- B) Endpoint
- C) Socket
- D) Proxy
Correct Answer: B) Endpoint
Question 41: Which HTTP method fetches resource data without altering server state?
- A) POST
- B) GET
- C) DELETE
- D) PUT
Correct Answer: B) GET
Question 42: Which protocol grants third-party app access without sharing passwords?
- A) JWT
- B) OAuth 2.0
- C) Basic Auth
- D) SAML
Correct Answer: B) OAuth 2.0
Question 43: Which HTTP status code indicates API rate limit exhaustion?
- A) 400
- B) 429 Too Many Requests
- C) 503 Service Unavailable
- D) 408 Request Timeout
Correct Answer: B) 429 Too Many Requests
Question 44: Which REST maturity level utilizes HATEOAS links?
- A) Level 0
- B) Level 3
- C) Level 1
- D) Level 2
Correct Answer: B) Level 3
Question 45: Which HTTP header passes authorization tokens like Bearer <token>?
- A) Accept
- B) Authorization
- C) Cookie
- D) Host
Correct Answer: B) Authorization
Question 46: Which HTTP method deletes a specified resource?
- A) PUT
- B) DELETE
- C) REMOVE
- D) PURGE
Correct Answer: B) DELETE
Question 47: Which status code indicates success with an empty response body?
- A) 200 OK
- B) 204 No Content
- C) 201 Created
- D) 302 Found
Correct Answer: B) 204 No Content
Question 48: Which protocol provides full-duplex communication over single TCP?
- A) REST
- B) WebSockets
- C) gRPC
- D) SOAP
Correct Answer: B) WebSockets
Question 49: Which REST property lets clients cache server responses locally?
- A) Stateless
- B) Cacheability
- C) Code on Demand
- D) Uniform Interface
Correct Answer: B) Cacheability
Question 50: Which web service architecture relies on XML and strict WSDL?
- A) GraphQL
- B) SOAP
- C) WebSockets
- D) gRPC
Correct Answer: B) SOAP
Conclusion
Mastering these Web Technologies MCQs builds practical web development and API integration skills. Practicing these Web Technologies MCQs regularly ensures you fully understand HTML5, CSS3, JavaScript, HTTP status codes, REST rules, and JWT auth, helping you secure top scores in exams and technical interviews through these Web Technologies MCQs.
Related Subject-wise MCQs:

7 Comments