-
1What does HTML stand for?
- AHyper Transfer Markup Language
- BHyperText Markup LanguageCorrect
- CHigh-level Text Management Language
- DHyperText Management Logic
Why: HTML stands for HyperText Markup Language. It is the standard language for creating web pages, providing the structure and meaning of web content through a system of elements represented by tags. 'HyperText' refers to text that contains links to other texts, while 'Markup' refers to the tags used to annotate content.
-
2What is the primary purpose of CSS in web development?
- ATo define the structure and content of web pages
- BTo handle server-side logic and database queries
- CTo control the visual presentation and layout of HTML elementsCorrect
- DTo manage user authentication and sessions
Why: CSS (Cascading Style Sheets) controls the visual presentation of HTML elements — including colors, fonts, spacing, layout, and responsive behavior. The separation of structure (HTML) from presentation (CSS) is a fundamental principle of web development that makes code more maintainable and allows the same content to be styled differently for different devices.
-
3What does HTTP status code 404 indicate?
- AThe server encountered an internal error
- BThe request was successful
- CThe requested resource was not foundCorrect
- DThe user is not authorized to access the resource
Why: HTTP 404 means 'Not Found' — the server could not locate the requested resource. This is one of the most common HTTP status codes. Other important codes include 200 (OK), 301 (Moved Permanently), 400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), and 500 (Internal Server Error).
-
4What is the Document Object Model (DOM)?
- AA database for storing web page content
- BA programming interface that represents an HTML document as a tree of objectsCorrect
- CA CSS framework for building responsive layouts
- DA protocol for transferring data between servers
Why: The DOM is a programming interface for HTML and XML documents. It represents the document as a tree of nodes and objects, allowing JavaScript to dynamically access and update the content, structure, and style of a web page. When you use JavaScript to change what appears on a page without reloading it, you are manipulating the DOM.
-
5What is 'responsive design' in web development?
- AA design that responds quickly to user clicks
- BA design approach that adapts layouts across a range of viewport sizes and device capabilitiesCorrect
- CA design that responds to user preferences stored in cookies
- DA design that automatically updates content in real time
Why: Responsive design uses flexible layouts, media queries, and adaptable media to respond to characteristics of the viewing environment. It aims to support a useful range of viewport sizes and capabilities, but the label does not guarantee that every page works perfectly on every device; representative layouts and interactions still need testing.
-
6In web development, what is an API?
- AA type of database used to store web pages
- BA set of rules that lets one piece of software request data or services from anotherCorrect
- CA tool for designing the visual layout of a site
- DA programming language used only for mobile apps
Why: An API (Application Programming Interface) is a defined set of rules that lets different software systems communicate. On the web, front-end code commonly calls a web API — often returning JSON — to fetch or send data, such as loading posts, submitting a form, or getting weather information. APIs let developers build on existing services without needing to know their internal details.
-
7What is the main purpose of the 'alt' attribute on an HTML image element?
- ATo make the image load faster
- BTo provide an appropriate text alternative that conveys the image's purpose or meaning in contextCorrect
- CTo set the image's width and height
- DTo turn the image into a clickable link
Why: The `alt` attribute supplies a text alternative for an image. The right value depends on context: an informative image needs a concise equivalent of its relevant meaning, a functional image should communicate the action or destination, and a purely decorative or redundant image normally uses an empty value (`alt=""`) so assistive technology can skip it.
-
8What best describes the difference between front-end and back-end web development?
- AFront-end is for mobile and back-end is for desktop
- BFront-end is what runs in the user's browser; back-end is the server-side logic and data the user does not seeCorrect
- CFront-end uses databases while back-end uses only HTML and CSS
- DThere is no real difference; the terms are interchangeable
Why: Front-end development covers what runs in the browser — the HTML, CSS, and JavaScript that create the user interface. Back-end development covers the server side: application logic, databases, authentication, and APIs that the user does not directly see. 'Full-stack' developers work across both, and the two layers typically communicate over HTTP, usually through APIs.
-
9What does an HTTP 301 status code indicate?
- AThe page is temporarily unavailable
- BThe requested resource has moved permanently to a new URLCorrect
- CThe user must log in to continue
- DThe server is overloaded
Why: A 301 response means the target resource has been assigned a new permanent URI, and the server should send that URI in the `Location` header. User agents may automatically redirect future requests. A 302 is also a redirect response, but it indicates that the resource resides temporarily under a different URI.
-
10What is the primary role of JavaScript on a web page?
- ATo define the page's structure and content
- BTo style colors, fonts, and layout
- CTo add interactivity and dynamic behavior, such as responding to clicks and updating contentCorrect
- DTo store data permanently on the server
Why: If HTML provides structure and CSS provides presentation, JavaScript provides behavior. It runs in the browser to make pages interactive — handling events like clicks, validating forms, fetching data without a full reload, animating elements, and updating the DOM dynamically. Together, HTML, CSS, and JavaScript are the three core technologies of the front-end web.