MCQ-11A client sends POST /v1/bookings with Content-Type: application/json and a body that parses cleanly: {"room_id": "r-17", "start_date": "2024-03-10", "end_date": "2024-03-08"}. The endpoint accepts application/json, its schema requires end_date to be later than start_date, and the request carries no conditional headers. Which status code should the API return?⌄
MCQ-13A client retries any request that gets no response within 2 s. A POST /charges times out; the server log shows the charge was inserted at t=1 s, and the retry inserts a second charge. Which statement explains why the retry was unsafe?⌄
MCQ-1A campaign tool exposes `GET /api/v1/campaigns/{id}/send-test`, which sends one test email and appends one row to `send_log` on every request. The URL appears once in a campaign email delivered to 400 recipients. The mail gateway's link scanner fetches every URL in a message once when that copy is delivered and once more each time the recipient opens the message. Each recipient opens the message twice, and none of them clicks the link. How many rows does `send_log` gain for this campaign?⌄
MCQ-23A product page renders its add-to-cart control as `<a href="/cart/add?sku=ABC">Add to cart</a>`. `GET /cart/add` appends one unit of `sku` to the caller's session cart and returns 200. The site runs a link prefetcher that fetches a link from the origin when it enters the viewport and again when the pointer rests on it for 100 ms; both fetches carry the user's session cookie. A search-engine crawler also fetches the page, with no session cookie. A user with an empty cart loads the page, scrolls until the link is visible, rests the pointer on it for 400 ms, then clicks it once. How many units are in that user's cart afterwards?⌄
MCQ-10An orders API sits behind a gateway that authorizes a request by reading the order id from the path (/orders/{orderId}/...) and checking the caller owns that order; if the path carries no order id, it checks only that the caller is signed in. The gateway accepts only GET, POST and DELETE; PUT and PATCH return 405. The mobile client prefetches every URL the order screen renders as a link as soon as the screen loads. A cancelled order must stay readable at GET /orders/123 with status "cancelled". Which endpoint should the team expose to cancel order 123?⌄
MCQ-5A config-sync job issues PUT /v1/tenants/{tenant}/limits with the full limits document every 5 minutes for a fleet of 12 tenants. The handler upserts the row and commits it before writing the response. The team's provisioning dashboard counts every 201 as a newly provisioned tenant, and the sync job reads the version field from the response body to decide whether its local copy has drifted. The row for tenant acme already exists when this request arrives. Which response should the handler return?⌄
MCQ-21A CLI starts an export with `POST /exports` and receives `202 Accepted` with `Location: /exports/7f2` and `Retry-After: 10`. The export takes about 45 s. The CLI's handler (JavaScript, Node 18+) is:
```js
const res = await fetch('/exports', { method: 'POST' });
if (res.status === 200) printCsv(await res.text());
else throw new Error(`export failed: ${res.status}`);
```
Exports never print. What should the handler do instead?⌄
MCQ-15A client SDK must show a different message for 'card declined' than for 'insufficient funds'. A service returns both as HTTP 400 with an `application/problem+json` body; it localizes `title` into three languages and rewrites `detail` wording between releases. Which member should the SDK branch on to tell the two failures apart?⌄
MCQ-25A payments API has 60 endpoints. Every one of them reports a rejected request as HTTP 4xx or 5xx with a body of `{"error": {"code": "...", "message": "..."}}`. The nine endpoints the fraud team shipped last quarter instead return HTTP 200 with `{"errors": [{"code": "...", "message": "..."}]}`. The client SDK's middleware retries on 429 and 5xx, reads `error.code` and raises a typed exception on any other 4xx, and returns the parsed body to the caller on 2xx. A caller invokes a fraud endpoint and the request is rejected. What does the caller get?⌄
MCQ-4Payments API returns HTTP 200 with `{"ok":false,"error":"..."}` for every failure, including its own downstream timeouts. Checkout calls it through an HTTP client configured to retry only on 5xx and connection errors (3 attempts, 100 ms backoff), and the mesh circuit breaker opens when the 5xx ratio over a 30 s window exceeds 50%. During a 10-minute payments outage every call returns 200 with an error body. What happens at checkout during the outage?⌄
MCQ-9Page 42 on a wiki API is versioned with revision ETags, and every write must carry If-Match. At 10:00 editor A reads the page and gets ETag "rev-7" with a 1,204-byte body. At 10:03 editor B saves a 3-byte title fix under If-Match: "rev-7"; the server accepts it, and the page is now ETag "rev-8" with 1,207 bytes. At 10:05 A's client sends PUT with If-Match: "rev-7" carrying the 1,206-byte payload it built from the body A read; the server replies 412 Precondition Failed and writes nothing. The client re-reads the page, gets ETag "rev-8", and 30 seconds later retries the same 1,206-byte payload with If-Match: "rev-8". Nobody else writes in between. What is page 42 after that retry returns?⌄
MCQ-6An API runs on six identical instances behind a round-robin load balancer with no sticky sessions, and the autoscaler replaces instances at any time. A new handler stores each user's cart in a process-local Map keyed by user ID on POST /cart/items, and GET /cart reads that Map. After deploy, a user's cart comes back empty on about five of every six GETs, and is never empty on the instance that handled the POST. The team cannot add any new infrastructure this quarter, but the service already uses a Postgres database for orders. Which change fixes the empty-cart reads?⌄
MCQ-16A 5-step insurance quote wizard runs on 8 pods behind a load balancer that round-robins requests with no session affinity. Each pod keeps in-progress wizard state in a process-local map. The fleet autoscales between 4 and 20 pods and rolls a deploy twice a day. About 3% of wizard sessions fail with 'step 3 not found', and the rate reaches 12% during a deploy. Each wizard accumulates about 40 KB of answers and uploaded document references. Compliance requires that completed quotes be retained for 30 days and that a locked account's in-progress quote stop being served within one second. Which change fixes the failures and meets the compliance requirements?⌄
MCQ-7A feed table holds 40M rows ordered by (created_at DESC, id DESC). The UI pages 20 rows at a time with next/previous only, users routinely scroll past page 500, and new rows arrive continuously with the newest created_at. The team is choosing between OFFSET/LIMIT and keyset (cursor) pagination. Which statement best explains why the cursor wins here?⌄
MCQ-20GET /v1/events?limit=N&offset=M passes N straight into SQL as LIMIT N. The web UI never asks for more than 50 rows, but nothing stops a caller from sending more. The events table holds 40 million rows of about 1 KB each, and the service shares a 20-connection pool with the rest of the API. A client starts sending limit=100000 with offsets that stay under 1000. Within a minute, p99 latency for every other endpoint on that pool rises from 40 ms to 3 s, and all 20 connections are busy running the events query, which completes in about 1.2 s each. Which change removes the cause of the slowdown?⌄
MCQ-12A gateway allows 200 requests per key in each fixed one-second window and answers every 429 with `Retry-After: 1`. At 12:00:00.000 a spike delivers 1,000 requests for one key in the same instant: 200 are served and 800 get 429. Every client honors Retry-After by sleeping exactly the stated seconds, and none adds jitter. What happens in the second starting at 12:00:01.000?⌄
MCQ-8An orders API serves 14 partner integrations. Two of them parse every response with generated clients configured to fail on any property the model does not declare; the other twelve ignore properties they do not know. No partner can rebuild or reconfigure a client before next week, and the team wants the new loyaltyTier value available to callers this week without breaking any of the fourteen. Which change fits?⌄
MCQ-17`GET /v1/orders` returns a bare JSON array of every order on the account. The shipped mobile client decodes it as `[Order]` and renders `orders.count` as the total. One account now has 40,000 orders, so the response is 90 MB and takes 12 s. To avoid breaking shipped clients, the team keeps the array shape and adds `?limit=` and `?cursor=`, defaulting to the 100 most recent orders when neither is sent. What do the shipped clients do once this is deployed?⌄
MCQ-18A read-heavy public API serves 40,000 req/s through a CDN configured to cache on URL only. Clients pick the version with an `X-API-Version` header. On-call finds that 3% of v2 requests come back with v1-shaped JSON, the `currency` field is missing, and the access log records only the URL, so the failing version cannot be identified. The team moves the version into the path (`/v2/orders`). Which outcome follows directly from that change?⌄
MCQ-19A team is ready to remove v1 of their public API. Since the v2 launch, v1 traffic has fallen from 2 million to 40,000 requests a day and has held flat there for three weeks. The team has already confirmed those calls are not their own monitoring or health checks, they arrive from external IPs, and the account list shows every paying customer has migrated. They plan to set a removal date. What should they do first?⌄
MCQ-24A payments team keeps a hand-written OpenAPI 3.1 document in the repo. CI generates the TypeScript client and the docs site from that document and nothing else. A backend engineer adds an optional `?include=refunds` query parameter to `GET /customers/{id}` in the handler and deploys, without touching the document. Which outcome follows?⌄
MCQ-22An orders service cancels orders with `POST /orders/{id}/cancel`, which returns 200 with the outcome in the body. About 4% of attempts fail because the warehouse has already picked the order, and customers retry, so one order can accumulate several attempts. Support gets roughly 200 tickets a week asking whether a particular cancellation went through, sometimes weeks after the fact, and cannot answer them: the response is the only place an outcome ever appears, and the customer often never saw it. Which change fixes this?⌄