RESTful API & Middleware Design Flashcards
7 cards from real CSI practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 RESTful API & Middleware Design flashcards as text
Which middleware pattern stores frequently accessed data closer to the consumer to reduce upstream API calls?
Answer: Caching proxy
A caching proxy intercepts requests and returns stored responses when valid, reducing latency and backend load.
A REST API must expose the same resource in both JSON and XML formats based on client preference. Which mechanism should it use?
Answer: HTTP Accept header content negotiation
Content negotiation via the Accept header is the HTTP-standard mechanism for clients to specify their preferred response format.
What does the Richardson Maturity Model Level 3 (Hypermedia Controls) require of a REST API?
Answer: Responses that include links guiding clients to available next actions
Level 3 (HATEOAS) requires responses to embed hypermedia links so clients can discover and navigate possible state transitions.
In middleware design, a circuit breaker transitions to the 'open' state when:
Answer: A configurable number of consecutive failures occurs
A circuit breaker opens after a defined failure threshold is reached, stopping further calls to the failing downstream service.
Which REST API design practice best prevents over-fetching and under-fetching issues?
Answer: Supporting sparse fieldsets via query parameters like ?fields=id,name
Sparse fieldsets allow clients to request only the specific fields they need, reducing payload size and avoiding under-fetching.
When an API gateway performs request transformation, what is it doing?
Answer: Modifying request structure or format before forwarding to backend services
Request transformation adapts incoming requests (e.g., headers, body format, parameters) to match what backend services expect.
Which HTTP response status code indicates that a REST API resource has been permanently moved to a new URI?
Answer: 301 Moved Permanently
301 Moved Permanently tells clients and search engines to update their references to the new URI for all future requests.