Questions 1–140) Verified Questions and Correct Answers
with Rationales
1. Which HTML element defines the main heading of a webpage?
A. <head>
B. <header>
C. <h1> (CORRECT)
D. <main>
Rationale: <h1> is used for the page’s primary heading and carries the highest semantic
importance for accessibility and SEO.
2. Which of the following are considered semantic HTML elements? (Select all
that apply.)
A. <article> (CORRECT)
B. <section> (CORRECT)
C. <div>
D. <header> (CORRECT)
Rationale: Semantic elements clearly describe their purpose to browsers and assistive
technologies, unlike generic <div> elements.
3. In CSS, which property changes the background color of an element?
A. color
B. background-color (CORRECT)
C. fill
D. border-color
Rationale: background-color sets the color behind an element’s content and padding area.
4. Which JavaScript keyword declares a variable whose value cannot be
reassigned?
,A. let
B. const (CORRECT)
C. var
D. define
Rationale: const creates block-scoped constants whose values cannot be reassigned once
defined.
5. Which HTTP method is typically used to retrieve data from a web server?
A. GET (CORRECT)
B. POST
C. PUT
D. DELETE
Rationale: GET requests data from a specified resource without altering it.
6. Which of the following CSS properties are used in Flexbox layout? (Select all
that apply.)
A. display: flex (CORRECT)
B. justify-content (CORRECT)
C. align-items (CORRECT)
D. grid-template-columns
Rationale: Flexbox controls one-dimensional layouts with properties like justify-content and
align-items; grid-template-columns belongs to CSS Grid.
7. What does the JavaScript JSON.parse() function do?
A. Converts an object into a JSON string
B. Converts a JSON string into an object (CORRECT)
C. Parses XML data
D. Fetches JSON from a file
Rationale: JSON.parse() reads JSON-formatted strings and turns them into JavaScript objects
for use in code.
8. What is the correct HTML structure for a webpage?
,A. <html><head></head><body></body></html> (CORRECT)
B. <html><body><head></head></body></html>
C. <head><html><body></body></html>
D. <body><html><head></head></html>
Rationale: The <head> must come before <body> inside <html> for valid document structure.
9. Which of the following HTTP response codes indicates “Not Found”?
A. 200
B. 403
C. 404 (CORRECT)
D. 500
Rationale: 404 means the requested resource could not be found on the server.
10. Which HTML attribute is required in an <img> tag for accessibility?
A. title
B. srcset
C. alt (CORRECT)
D. height
Rationale: The alt attribute provides text alternatives for screen readers and displays if the
image cannot load.
11. Which CSS unit scales relative to the root font size?
A. em
B. rem (CORRECT)
C. px
D. %
Rationale: rem (“root em”) units are based on the font size of the <html> element, ensuring
consistent scaling.
12. Which statement best describes an API?
A. A graphical interface for design
B. A set of rules that allows software to communicate (CORRECT)
C. A programming language
, D. A browser tool for testing
Rationale: APIs enable communication between different software components or services.
13. Which of the following are asynchronous JavaScript mechanisms? (Select all
that apply.)
A. Promises (CORRECT)
B. async/await (CORRECT)
C. Callbacks (CORRECT)
D. Synchronous loops
Rationale: JavaScript handles asynchronous tasks using callbacks, Promises, and the
async/await syntax.
14. What does CSS stand for?
A. Cascading Sheet Style
B. Cascading Style Sheets (CORRECT)
C. Creative Styling System
D. Cascading Script Styles
Rationale: CSS stands for Cascading Style Sheets — it defines how HTML elements are
displayed.
15. Which of the following helps ensure website accessibility?
A. Providing alt text for images (CORRECT)
B. Using semantic HTML (CORRECT)
C. Removing labels from form fields
D. Using <div> for everything
Rationale: Accessible design relies on semantic markup and alternative text for non-text
content.
16. Which CSS property defines the outer spacing around an element?
A. padding
B. margin (CORRECT)
C. border
D. outline