🎓 BookMCQ
← Back to 26. Standard Client Server Protocols

📝 HTTP protocol explained with example (46 MCQs)

HTTP's Request–Response Communication Model

HTTP organizes communication as requests from a client and responses from a server. A request identifies a target resource and expresses an intended action through its method; a response reports the outcome and may carry a representation. HTTP is stateless at the protocol level, so each request is interpreted independently unless an application uses cookies or other state mechanisms. These shared semantics let different browsers and servers interoperate reliably across different operating environments.

Methods, Targets and Header Fields

An HTTP request includes a method, request target and protocol-version information, followed by header fields and an optional body. Common methods include GET for retrieval and POST for resource-specific processing. A response contains a status code, headers and optional content. Headers describe items such as media type, content length, caching and accepted formats.

Parsing a Request and Constructing a Response

The client sends a request after establishing the required connection. The server reads the start line and fields, checks permissions and resource handling, and executes the method. It then sends a status line or equivalent protocol metadata, response fields and any content. The client interprets the status and decides whether to display, redirect or retry.

A GET Exchange for a Specific Web Resource

A browser requests /notes.html from example.net using GET. The server finds the document and returns 200 OK with Content-Type: text/html and the HTML bytes. If the path is unavailable, it can instead return 404 Not Found. The differing status values describe the processing result, not the physical condition of the network.

Status Codes and Representation Metadata

HTTP methods describe application intent, while TCP or QUIC carries data between endpoints. A Content-Type field describes the representation format, whereas Content-Length describes a message content length when applicable. Redirect responses can direct the client to another URI, and cache-control fields influence whether an intermediary may reuse a stored response.

Frequent Errors in Reading HTTP Examples

'GET always changes server data' is incorrect because GET is defined as a retrieval method and should not request a state change. 'POST is the only method with a body' is false because other methods can carry content. '200 means the page is visually correct' is wrong because it reports protocol-level success, not whether the returned content meets the user's needs.

Analyzing HTTP Requests and Response Codes

Practice identifying the request line, target, method, headers, optional body, response status and response content. Recognize 200 as success, 301 or 302 as redirection, 400 as a client error, 404 as not found and 500 as a server error. Check that explanations distinguish protocol outcome from browser rendering and application logic.

HTTP Message and Response Terms

  • Request - Asks a server to perform an operation.
  • Response - Reports processing results to a client.
  • GET - Retrieves a current resource representation.
  • Status code - Indicates the result of a request.
  • Content-Type - Identifies the returned media format.
  • Header - Carries message metadata.
9
Easy
21
Medium
16
Hard

📝 All HTTP protocol explained with example MCQs

Q1. In a client‑server interaction, if a client repeatedly sends malformed requests causing the server to close the connection, what is the most likely cause of this behavior?

A.The client is using an unsupported HTTP method
B.The server detects a security threat and terminates the session ✅
C.Network congestion leads to packet loss
D.The client’s DNS resolution is failing
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The server monitors request syntax and, upon detecting malformed or suspicious requests, often closes the connection to protect resources. This defensive behavior is typical when the server identifies a potential security threat, such as injection attempts, rather than issues like unsupported methods or DNS failures.

Q2. A web application uses both GET and POST methods for the same resource. Which reasoning best explains why this might be problematic for caching mechanisms?

A.GET requests are always cached while POST are never cached
B.POST requests may include a request body that changes server state, confusing caches
C.Caching proxies treat GET and POST identically, causing duplicate entries ✅
D.Browsers ignore caching headers for POST requests
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Caching proxies generally differentiate based on method; GET is cache‑friendly, while POST is intended for state‑changing operations. When both methods are used for the same URI, caches may store inconsistent representations, leading to stale or duplicate data, because they cannot reliably decide which representation reflects the latest state.

Q3. If a server implements HTTP/2 multiplexing, what inference can be drawn about its handling of head‑of‑line blocking compared to HTTP/1.1?

A.HTTP/2 introduces more head‑of‑line blocking due to binary framing
B.Multiplexing eliminates head‑of‑line blocking within a single connection ✅
C.Head‑of‑line blocking is unchanged because it is a TCP issue
D.HTTP/2 only reduces blocking for TLS connections
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: HTTP/2’s multiplexing allows multiple streams to coexist on one TCP connection, so a blocked or delayed stream does not stall others. This design directly addresses the head‑of‑line blocking problem present in HTTP/1.1, where each request‑response pair occupies its own connection, causing delays if one stream stalls.

Q4. Consider a scenario where a client uses persistent connections but the server closes the socket after each response. Which logical deduction explains the mismatch?

A.The client disabled keep‑alive in its request headers
B.The server does not support HTTP/1.1 persistent connections
C.Network middleboxes strip the Connection header ✅
D.The client’s firewall forces connection termination
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Middleboxes such as proxies or firewalls sometimes remove or alter the Connection header, causing the server to believe the client does not request persistence. Consequently, the server closes the socket after each response, even though the client originally indicated a desire for a persistent connection.

Q5. A developer claims that adding more request headers will always improve security. Which analytical assessment best refutes this claim?

A.More headers increase the packet size, causing latency
B.Excessive headers can expose implementation details to attackers ✅
C.Headers are encrypted, so they have no security impact
D.Additional headers are ignored by modern browsers
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: While headers can convey security directives (e.g., CSP, HSTS), adding many unnecessary headers may leak information about server configuration, software versions, or internal policies. This exposure can aid attackers in fingerprinting the system, thereby reducing overall security rather than enhancing it.

Q6. When comparing HTTP status codes 301 and 302, which conceptual difference is most accurate regarding client behavior?

A.Both always use GET for the redirected request
B.301 forces a permanent cache, while 302 does not guarantee method preservation ✅
C.302 indicates a temporary redirect that must preserve the original method
D.301 is only used for HTTPS to HTTP redirects
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A 301 (Moved Permanently) signals that the resource has a new permanent URI, prompting clients to update bookmarks and cache the new location. A 302 (Found) is temporary; clients may repeat the request at the original URI later, and the method may change (often to GET), reflecting the transient nature of the redirect.

Q7. If an HTTP response includes both Cache‑Control: no-store and ETag headers, what is the most logical effect on caching behavior?

A.The response will be cached but never revalidated
B.The response will be stored but not served to other clients
C.The response will not be stored, making ETag irrelevant for caching ✅
D.ETag overrides no-store, allowing conditional requests
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Cache‑Control: no-store explicitly instructs caches not to retain the response. Consequently, any ETag present cannot be used for subsequent cache validation because the response is never stored. The ETag may still be useful for conditional requests to the origin server, but it does not affect caching.

Q8. A web service returns a JSON payload with a Content‑Type of text/html. Which inference best explains the potential client‑side issue?

A.Browsers will automatically parse the JSON correctly
B.The client may treat the payload as HTML, causing parsing errors ✅
C.The server will reject the request due to mismatched types
D.Text/html forces the client to ignore the payload
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: When the Content‑Type header does not match the actual payload format, clients rely on the declared type. Declaring text/html for JSON leads browsers or libraries to attempt HTML parsing, resulting in errors or ignored data, whereas the correct application/json type would enable proper JSON deserialization.

Q9. Suppose a client sends a request with the Expect: 100‑continue header but never receives the interim 100 response. Which logical conclusion is most plausible?

A.The server does not support the Expect header and will wait indefinitely
B.The network dropped the 100 response due to congestion
C.The client misinterpreted the final response as the interim one
D.The server chose to reject the request without sending 100 ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: When a server does not wish to process the request body, it can immediately send a final status (e.g., 4xx) without the interim 100 Continue. This behavior indicates the server’s decision to reject or ignore the request, rather than a network issue or client error.

Q10. In a RESTful API design, which analytical comparison best illustrates the advantage of using HTTP verbs over RPC‑style endpoints?

A.Verbs reduce URL length compared to RPC methods
B.Verbs enable statelessness while RPC requires stateful sessions
C.Verbs map directly to CRUD operations, promoting uniform interface ✅
D.RPC endpoints are more cacheable than verb‑based URLs
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: REST leverages HTTP verbs (GET, POST, PUT, DELETE) to represent Create, Read, Update, Delete actions uniformly across resources. This uniform interface simplifies client logic, enhances cacheability, and aligns with web standards, whereas RPC endpoints often embed action names in URLs, breaking the uniformity principle.

Q11. A CDN edge server returns a stale object after the origin server has updated the resource. Which conceptual reason most likely explains this behavior?

A.The CDN does not respect Cache‑Control directives
B.The CDN’s TTL has not yet expired ✅
C.The client forced the CDN to serve the old content
D.Network latency prevents the CDN from fetching the new version
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: CDNs honor the Time‑to‑Live (TTL) value set by the origin. Until the TTL expires, the edge server serves the cached copy, even if the origin has newer content. This design reduces load on the origin and improves latency, but can temporarily serve stale data.

Q12. If a client repeatedly receives HTTP 429 responses, what deduction can be made about the server’s policy?

A.The server is experiencing internal errors
B.The client is exceeding rate‑limit thresholds ✅
C.Network congestion is causing dropped packets
D.The client’s SSL certificate is invalid
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: HTTP 429 (Too Many Requests) explicitly indicates that the client has sent too many requests in a given time window, triggering the server’s rate‑limiting mechanism. It is not related to internal errors, network congestion, or certificate issues.

Q13. When analyzing logs, a pattern shows that GET requests to /api/data always return 200, but POST requests to the same endpoint return 405. Which analytical explanation best fits?

A.The server disables POST for security reasons
B.The endpoint is read‑only and does not support creation ✅
C.The client lacks proper authentication for POST
D.The firewall blocks POST traffic
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: A 405 Method Not Allowed response indicates that the HTTP method is not supported for the targeted resource. If GET succeeds but POST fails consistently, the endpoint is likely designed as read‑only, intentionally rejecting POST operations.

Q14. A client sends an HTTP request with both Transfer‑Encoding: chunked and Content‑Length headers. Which logical reasoning best describes the server’s expected handling?

A.The server must prioritize Content‑Length over chunked encoding
B.The server must ignore both headers and close the connection
C.The server should follow the Transfer‑Encoding and ignore Content‑Length ✅
D.The server will return a 400 Bad Request due to header conflict
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: According to RFC 7230, when Transfer‑Encoding is present, the server must ignore any Content‑Length header because chunked encoding defines the message length. The presence of both headers is not an error; the server processes the message using the chunked transfer method.

Q15. If an HTTP response includes the header Strict‑Transport‑Security: max‑age=31536000; includeSubDomains, which conceptual impact does this have on future client requests?

A.Clients will downgrade to HTTP for subdomains
B.Clients must use HTTPS for the specified domain and all subdomains for one year ✅
C.Clients may ignore the header if they use HTTP/1.0
D.The header only affects browsers, not APIs
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The Strict‑Transport‑Security (HSTS) header instructs compliant browsers to automatically use HTTPS for the originating domain and all its subdomains for the duration specified by max‑age (here, one year). This prevents downgrade attacks and ensures secure connections for future requests.

Q16. Which factual recall question correctly identifies the default port for HTTPS?

A.80
B.443 ✅
C.21
D.25
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: HTTPS, the secure version of HTTP, uses TCP port 443 by default, whereas plain HTTP uses port 80. This is a standard convention defined by the IANA.

Q17. What is the primary purpose of the HTTP OPTIONS method?

A.To retrieve a resource
B.To delete a resource
C.To describe the communication options available for a target resource ✅
D.To update a resource
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The OPTIONS method asks the server which HTTP methods and other capabilities are supported for a given resource, allowing clients to discover allowed actions without performing them.

Q18. Which factual recall question correctly defines the meaning of the HTTP status code 404?

A.Resource created successfully
B.Resource not found ✅
C.Server error
D.Request accepted for processing
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The 404 status code indicates that the server cannot find the requested resource. It is a client‑side error meaning the URI does not map to any existing content.

Q19. In HTTP/1.1, which header is used to indicate that a connection should be closed after the current request/response cycle?

A.Keep-Alive
B.Connection: close ✅
C.Upgrade
D.Cache-Control
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The Connection header with the value close tells the server to close the TCP connection after completing the current request/response, overriding the default persistent connection behavior of HTTP/1.1.

Q20. A client receives an HTTP 301 response with a Location header pointing to a new URL that uses the same scheme. Which logical deduction about caching is most accurate?

A.Clients must ignore the redirect for caching
B.Clients should cache the new URL as the canonical location ✅
C.Clients must revalidate the original URL on each request
D.Caching is prohibited for 301 responses
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A 301 Moved Permanently response tells clients that the resource has a new permanent URI. Clients typically update their caches and future requests to use the new URL, treating it as the canonical location for the resource.

Q21. When comparing HTTP/1.1 pipelining with HTTP/2 multiplexing, which analytical distinction best captures their performance differences?

A.Both eliminate head‑of‑line blocking equally
B.HTTP/2 multiplexing allows interleaving of frames from multiple streams, while pipelining still suffers from head‑of‑line blocking within a single connection ✅
C.Pipelining provides better compression than multiplexing
D.Multiplexing requires multiple TCP connections unlike pipelining
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: HTTP/1.1 pipelining sends multiple requests without waiting for responses, but the server must reply in order, causing head‑of‑line blocking if an early response is delayed. HTTP/2 multiplexing sends frames from many streams concurrently, eliminating this blockage and improving overall throughput.

Q22. If an API returns a 202 Accepted status after receiving a POST request, what conceptual implication does this have for the client?

A.The request was malformed
B.The request has been processed synchronously
C.The request has been accepted for processing but not yet completed ✅
D.The resource already exists
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: A 202 status indicates that the server has accepted the request for processing, but the processing is not yet finished. The client may need to poll or be notified later to determine the final outcome.

Q23. A server sends the header Vary: Accept-Encoding. Which analytical conclusion about caching can be drawn?

A.Caches will store a single version regardless of encoding
B.Caches must store separate representations for each encoding type ✅
C.Vary header disables caching entirely
D.Vary only affects proxy servers, not browsers
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The Vary header tells caches that the response varies based on the specified request header(s). With Accept-Encoding, caches must keep distinct versions for gzip, deflate, etc., ensuring the client receives the appropriate encoding.

Q24. When a client includes the header If-None-Match with an ETag value, which conceptual behavior does the server exhibit if the resource has not changed?

A.It returns 200 with the full payload
B.It returns 304 without a payload ✅
C.It returns 404 indicating the resource is missing
D.It returns 500 due to server error
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: If-None-Match contains an ETag that matches the current version of the resource, the server responds with 304 Not Modified, indicating the client can use its cached copy and no message body is sent.

Q25. Which logical reasoning best explains why a proxy might transform an HTTP request from HTTP/1.1 to HTTP/0.9?

A.The proxy wants to reduce bandwidth usage ✅
B.The client does not support HTTP/1.1 features
C.The origin server only accepts HTTP/0.9
D.The proxy aims to strip headers for security
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Proxies sometimes downgrade the protocol version to reduce overhead, especially in low‑bandwidth environments. By sending an HTTP/0.9 request, which lacks headers, the proxy can minimize the amount of data transmitted, though this sacrifices functionality.

Q26. If a client receives a 401 Unauthorized response without a WWW‑Authenticate header, what deduction can be made about the server’s compliance?

A.The server correctly follows RFC 7235
B.The server is non‑compliant with authentication standards ✅
C.The client must resend the request with credentials
D.The response indicates a different error type
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: RFC 7235 requires a WWW‑Authenticate header in a 401 response to indicate the authentication scheme required. Its absence means the server is not adhering to the standard, leading to ambiguous client behavior.

Q27. A web application uses HTTP Basic authentication over an unencrypted connection. Which analytical assessment most accurately describes the security risk?

A.Credentials are sent in plain text and can be intercepted ✅
B.Basic authentication automatically encrypts the credentials
C.The risk is negligible because browsers hide the password
D.Only the username is exposed, not the password
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: HTTP Basic authentication transmits the user name and password encoded in Base64, which is not encryption. Over an unencrypted channel, anyone able to sniff traffic can decode and obtain the credentials, representing a serious security vulnerability.

Q28. When comparing cookie attributes, which conceptual difference best distinguishes Secure from HttpOnly?

A.Secure restricts transmission to HTTPS, HttpOnly restricts access from client‑side scripts ✅
B.Secure encrypts the cookie value, HttpOnly encrypts the cookie name
C.Secure limits cookie size, HttpOnly limits domain scope
D.Both attributes perform the same function
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The Secure attribute tells browsers to send the cookie only over secure (HTTPS) connections, protecting it from network eavesdropping. HttpOnly prevents client‑side scripts (e.g., JavaScript) from accessing the cookie, mitigating cross‑site scripting attacks. They address different threat vectors.

Q29. If a server includes the header Content‑Security‑Policy: default-src 'self'; script-src 'none', which conceptual effect does this have on page behavior?

A.All scripts are allowed from any source
B.Only scripts from the same origin are permitted
C.No scripts can be executed, and resources are limited to the origin ✅
D.The policy only applies to images, not scripts
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The CSP directive script-src 'none' disallows all script execution, while default-src 'self' limits other resource types (e.g., images, styles) to the same origin. Together, this policy blocks any JavaScript from running, enhancing security against XSS attacks.

Q30. A client sends a request with a malformed Host header. Which logical deduction explains the server’s likely response?

A.The server will ignore the header and process the request
B.The server will respond with 400 Bad Request ✅
C.The server will redirect to a default host
D.The server will return 200 OK regardless
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: A malformed Host header violates HTTP/1.1 requirements, prompting the server to reject the request with a 400 Bad Request status, indicating that the request cannot be understood due to syntactic errors.

Q31. Which factual recall question correctly identifies the purpose of the HTTP CONNECT method?

A.To retrieve a resource
B.To establish a tunnel to a remote host ✅
C.To delete a resource
D.To update a resource
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The CONNECT method is used by clients to establish a network tunnel, typically for SSL/TLS through an HTTP proxy, allowing a direct TCP connection to the target server.

Q32. When an HTTP response includes both Expires and Cache‑Control: max‑age directives, which analytical rule determines the effective freshness lifetime?

A.Expires always overrides Cache‑Control
B.Cache‑Control: max‑age takes precedence over Expires ✅
C.Both are combined to extend freshness
D.The shorter of the two durations is used
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: According to RFC 7234, the Cache‑Control max‑age directive overrides the Expires header when both are present, providing a more explicit freshness lifetime that the client must follow.

Q33. If a client receives an HTTP 307 Temporary Redirect, which conceptual behavior must it follow regarding the request method?

A.It must change the method to GET
B.It must preserve the original method and body ✅
C.It can choose any method for the redirected request
D.It must abort the request
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A 307 response indicates that the resource resides temporarily under a different URI, but the client must repeat the request using the same HTTP method and request body, unlike a 302 which may switch to GET.

Q34. A developer argues that using HTTP/1.0 with the Connection: keep‑alive header provides the same performance as HTTP/2. Which analytical critique best challenges this view?

A.HTTP/1.0 does not support TLS
B.HTTP/2 offers multiplexing, header compression, and binary framing absent in HTTP/1.0 ✅
C.keep‑alive does not affect latency
D.HTTP/1.0 cannot send any headers
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: While adding Connection: keep‑alive to HTTP/1.0 reduces connection overhead, it still lacks HTTP/2’s multiplexing (allowing multiple concurrent streams), header compression (HPACK), and binary framing, all of which significantly improve performance beyond simple keep‑alive.

Q35. When a client includes the Accept header with values text/html, application/json;q=0.8, what conceptual effect does the quality factor have?

A.It forces the server to always return JSON
B.It indicates a preference for HTML over JSON ✅
C.It disables HTML responses
D.It makes the request invalid
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The quality factor (q) assigns a relative weight to each media type. A higher value (default 1.0) for text/html means the client prefers HTML, while a lower q=0.8 for JSON indicates lower preference, guiding the server’s content negotiation.

Q36. If a server sends a Set‑Cookie header with the attribute SameSite=Strict, which logical outcome best describes subsequent cross‑site requests?

A.Cookies will be sent with all cross‑site requests
B.Cookies will be omitted on any cross‑site request, even if initiated by the user
C.Cookies will be sent only on safe HTTP methods
D.Cookies will be sent only if the request originates from the same site ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: SameSite=Strict instructs browsers to include the cookie only when the request originates from the same site as the cookie’s domain. Any cross‑site request, even user‑initiated, will not carry the cookie, mitigating CSRF attacks.

Q37. A REST API returns a 409 Conflict response when a client attempts to create a resource that already exists. Which analytical explanation best reflects the semantics of this status code?

A.The server cannot process the request due to an internal error
B.The request is syntactically incorrect
C.The request conflicts with the current state of the target resource ✅
D.The server does not recognize the request method
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: A 409 Conflict indicates that the request could not be completed because it would cause a conflict with the existing state of the resource, such as attempting to create a duplicate entity. This informs the client to resolve the conflict before retrying.

Q38. Which factual recall question correctly states the default HTTP version used by modern browsers when establishing a new connection?

A.HTTP/1.0
B.HTTP/1.1
C.HTTP/2.0 ✅
D.HTTP/3.0
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Modern browsers negotiate HTTP/2 (or higher) over TLS when both ends support it, but the baseline default without negotiation is HTTP/1.1. However, the question asks for the default version used when establishing a new connection, which is typically HTTP/2 if available. The correct answer is HTTP/2.0.

Q39. When a server includes both Pragma: no‑cache and Cache‑Control: max‑age=3600 in a response, which analytical reasoning explains the effective caching behavior?

A.Pragma overrides Cache‑Control, forcing no caching
B.Cache‑Control takes precedence, allowing caching for one hour ✅
C.Both directives are combined, resulting in no caching
D.The client may choose either directive arbitrarily
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Cache‑Control is the modern directive and overrides the legacy Pragma header. Therefore, despite Pragma: no‑cache, the response can be cached for the duration specified by max‑age (3600 seconds).

Q40. If a client sends a request with Transfer‑Encoding: chunked but the server does not support chunked encoding, what logical outcome is most likely?

A.The server will automatically convert the body to Content‑Length
B.The server will respond with 501 Not Implemented ✅
C.The server will ignore the request body and process headers only
D.The connection will be closed without a response
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: When a server does not understand the Transfer‑Encoding header, it should respond with 501 Not Implemented, indicating that the functionality required to process the request is not supported.

Q41. A web service uses HTTP/1.1 persistent connections but experiences high latency due to many small requests. Which conceptual improvement would most effectively reduce latency?

A.Increasing the TCP window size
B.Switching to HTTP/2 multiplexing ✅
C.Adding more DNS entries
D.Using larger payloads per request
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: HTTP/2 multiplexing allows multiple requests to be sent concurrently over a single connection, eliminating the need for sequential request/response cycles that cause latency in HTTP/1.1 when many small requests are made.

Q42. When a client receives an HTTP 500 Internal Server Error, which logical inference about the server’s state is most appropriate?

A.The client sent a malformed request
B.The server encountered an unexpected condition preventing it from fulfilling the request ✅
C.The requested resource does not exist
D.The client is not authorized to access the resource
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: A 500 status code signals that the server encountered an unexpected condition (e.g., unhandled exception) that prevented it from fulfilling the request. It does not imply client‑side errors such as malformed requests, missing resources, or authorization issues.

Q43. If an HTTP response contains the header X-Frame-Options: DENY, which conceptual effect does this have on the page?

A.The page can be embedded in any iframe
B.The page cannot be displayed in a frame or iframe at all ✅
C.The page can only be framed by the same origin
D.The header only affects scripts, not frames
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: X-Frame-Options: DENY instructs browsers to prevent the page from being displayed inside any frame or iframe, protecting against clickjacking attacks by disallowing embedding regardless of the embedding page’s origin.

Q44. A client uses the HEAD method to request a resource. Which analytical statement correctly describes the server’s expected response?

A.The server returns the full message body
B.The server returns only status line and headers without a body ✅
C.The server must return a 405 error
D.The server returns a 302 redirect
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The HEAD method is identical to GET except that the server must not include a message body in the response. It returns the status line and headers, allowing the client to inspect metadata (e.g., Content‑Length) without transferring the full content.

Q45. When evaluating the impact of HTTP pipelining, which logical reasoning explains why it might not improve performance on high‑latency networks?

A.Pipelining requires multiple TCP connections
B.Pipelining still suffers from head‑of‑line blocking if an early response is delayed ✅
C.Pipelining disables compression
D.Pipelining forces the use of HTTP/1.0
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Even though pipelining allows sending multiple requests without waiting for responses, the server must still send replies in order. If an early response is delayed, subsequent responses are blocked, negating the potential latency benefits, especially on high‑latency links.

Q46. A developer claims that setting Cache‑Control: public on a response automatically makes it cacheable by all intermediaries. Which analytical counter‑argument best refutes this claim?

A.Public directives are ignored by modern browsers
B.Intermediaries may still respect other directives like no‑store or private ✅
C.Public only applies to client‑side caches
D.Cache‑Control has no effect on caching behavior
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Cache‑Control: public indicates that the response may be stored by any cache, but other directives (e.g., no‑store, private) can override this permission. Intermediaries must respect the most restrictive applicable directive, so simply adding public does not guarantee caching if conflicting headers exist.

🔗 Related Topics (MCQs)