Difficulty: Easy & Basic
HTTP response status codes communicate what about a request?
A CSS priority
B Request outcome
C Domain ownership
D Image format
Answer: B. Request outcome. Status codes summarize the outcome of an HTTP request.
For retrieving a representation, which HTTP method is intended?
A POST
B PATCH
C CONNECT
D GET
Answer: D. GET. GET requests transfer a representation of the target resource.
Where is JSON commonly exchanged?
A HTTP request body
B CSS selector
C URL fragment
D HTML comment
Answer: A. HTTP request body. A request body can carry JSON data to a server.
Which status code commonly signals a successful request?
A 301
B 404
C 200
D 503
Answer: C. 200. 200 is the standard status for a successful request.
Why might a browser send an Origin header?
A Sets response language
B Identifies request origin
C Chooses image size
D Names a CSS class
Answer: B. Identifies request origin. Origin identifies the scheme, host, and port of a request’s origin.
How does a media query help responsive design?
A Applies conditional CSS
B Compresses JavaScript
C Validates a password
D Creates a server
Answer: A. Applies conditional CSS. Media queries apply CSS only when stated conditions match.
Among CSS layout systems, which arranges items along one main axis?
A Grid
B Float
C Table caption
D Flexbox
Answer: D. Flexbox. Flexbox primarily lays items along one main axis.
How does CSS Grid arrange content?
A HTTP headers
B Text alternatives
C Rows and columns
D DNS records
Answer: C. Rows and columns. Grid arranges items in rows and columns.
When is localStorage data normally retained?
A Only during one task
B Across browser restarts
C Until tab closes
D Only on servers
Answer: B. Across browser restarts. Local storage normally persists after the browser closes.
For a browsing tab, what data does sessionStorage hold?
A One browsing tab
B All websites
C Every device
D A DNS session
Answer: A. One browsing tab. Session storage is isolated to a page’s browsing context.
Which cookie attribute restricts cross-site sending?
A Content-Type
B Accept-Language
C SameSite
D Cache-Control
Answer: C. SameSite. SameSite controls whether cookies accompany cross-site requests.
How does a CDN commonly improve delivery?
A Edits HTML semantics
B Replaces DNS globally
C Validates form fields
D Serves nearby cached content
Answer: D. Serves nearby cached content. A CDN can serve cached copies from a nearby location.
Which standard attribute supplies an accessible name to a control?
A aria-label
B href
C srcset
D download
Answer: A. aria-label. aria-label can supply an accessible name when needed.
Resource not found is indicated by which status code?
A 200
B 404
C 301
D 503
Answer: B. 404. 404 means the target resource was not found.
When should POST be used to submit data for processing?
A GET
B HEAD
C POST
D TRACE
Answer: C. POST. POST performs resource-specific processing using request content.
Why can a browser issue a CORS preflight request?
A Check cross-origin permission
B Refresh local storage
C Choose CSS cascade
D Resolve a fragment
Answer: A. Check cross-origin permission. Preflight checks whether a cross-origin request is permitted.
In REST, what commonly identifies a resource?
A CSS class
B DOM event
C Cookie path
D URI
Answer: D. URI. A REST resource is commonly addressed by a URI.
Which header describes a message body’s media type?
A Origin
B Content-Type
C Referer
D ETag
Answer: B. Content-Type. Content-Type describes the media type of a message body.
How does a 301 response affect a client?
A Temporary failure
B Successful creation
C Permanent redirection
D Unauthorized access
Answer: C. Permanent redirection. 301 indicates a permanent redirect.
Before submission, what does client-side form validation check?
A Checks input before submission
B Encrypts response headers
C Routes server traffic
D Stores DNS records
Answer: A. Checks input before submission. Client-side validation checks entries before submitting the form.
On an HTML control, which attribute can make input mandatory?
A rel
B media
C scope
D required
Answer: D. required. Required marks a form control as mandatory.
When is a URL fragment identifier sent in an HTTP request?
A Only after redirects
B It is not sent
C With every POST
D Only over HTTPS
Answer: B. It is not sent. URL fragments are handled by the client and omitted from HTTP requests.
How can an image offer multiple resolutions?
A role attribute
B method attribute
C srcset attribute
D integrity attribute
Answer: C. srcset attribute. srcset lets browsers choose among image source candidates.
Which resource hint can start a connection early?
A nofollow
B preload only
C manifest
D preconnect
Answer: D. preconnect. Preconnect asks the browser to establish a connection early.
Which media type does application/json name?
A JSON media type
B CSS language mode
C HTML document type
D WebSocket frame
Answer: A. JSON media type. application/json labels JSON-formatted message content.