Every question on one page: open one, choose an answer, and see why at once. Signed in, your latest answer to each question counts, and you can answer again after 24 hours.
Curated: · Written: · Reviewed:
Reviewed 100Review pending 0
Answers to reviewed questions count toward this role and the overall leaderboard; your latest answer to each one is the one that counts.
MCQ-12A dashboard calls `GET /api/orders?status=pending`. The client shows a spinner while the request is in flight, renders "No pending orders" when the JSON body is an empty array, and shows an error banner with a retry button on a non-2xx response or a thrown fetch. The handler is:
```python
@app.get("/api/orders")
def list_orders(status: str):
try:
rows = db.query(status, timeout=30)
except DBError:
rows = []
return jsonify(rows), 200
```
During a 90-second replica failover the endpoint answered 2,140 requests with `200` and body `[]` in about 40 ms each; the replica held 1,800 pending orders. 340 users pressed Refresh and support logged 27 tickets about the orders page.
Why did the dashboard show "No pending orders" while 1,800 orders were pending?⌄
MCQ-11An invoice list page fetches `GET /api/invoices` through this wrapper (TypeScript 5.4, browser `fetch`):
```ts
async function loadInvoices() {
const res = await fetch('/api/invoices');
if (res.status === 401) return { data: [], error: { kind: 'auth' } };
if (res.status === 404) return { data: [], error: { kind: 'missing' } };
if (!res.ok) return { data: [], error: { kind: 'retry' } };
return { data: await res.json(), error: null };
}
```
The table component renders in this order:
```tsx
if (error?.kind === 'auth') return <SignIn />;
if (data.length === 0) return <Empty />; // "No invoices yet"
if (error?.kind === 'missing') return <NotFound />;
if (error?.kind === 'retry') return <Retry />; // "Try again"
return <List data={data} />;
```
During a 40-minute maintenance window the API returns 503 for every request; 673 customers saw the empty state and 112 of them submitted a second payment. What does the page show during that window?⌄
MCQ-2A feed caches each post's like count and paints a tap instantly, then reconciles with the server:
```js
async function onLike(post) {
const prev = post.likes; // 41, from the cached feed
setLikes(post.id, prev + 1); // paint 42 now
try {
const r = await api.like(post.id); // POST /posts/:id/like
setLikes(post.id, r.likes); // server truth
} catch (e) {
setLikes(post.id, prev); // rollback
}
}
```
`api.like` rejects on any non-2xx and puts the parsed response body on `e.body`. The same account liked this post from another device a minute ago, so the server row is already at 45 while this client's cached feed still says 41. The user taps like here; the server answers 409 with body `{"likes": 45}`. The tap must keep painting instantly, and the API contract is frozen this quarter.
Which change makes this client show 45 as soon as the request settles?⌄
MCQ-10An inbox lists conversations by `last_message_at DESC, id DESC`, 3 per page. The API uses keyset pagination: `WHERE (last_message_at, id) < ($1, $2) ORDER BY last_message_at DESC, id DESC LIMIT 3`. The client stores the last row's `(last_message_at, id)` and sends it as `before`. The table starts as:
| id | last_message_at |
| 1 | 10:00 |
| 2 | 10:00 |
| 3 | 09:59 |
| 4 | 09:58 |
| 5 | 09:57 |
| 6 | 09:56 |
| 7 | 09:55 |
The user loads page 1. A new message arrives for conversation 7 at 10:05. The user clicks next. Which `before` value should the client send to get the next page without duplicates or skips?⌄
MCQ-4An SPA served from https://app.example.com calls an API at https://api.example.net. The team replaces the localStorage bearer token with a session cookie: the API sets it on login with HttpOnly and Path=/, and DevTools shows it stored under api.example.net. Login returns 200, but every following fetch() from the SPA returns 401 and the request headers carry no Cookie. Which change makes the browser attach the cookie to those fetch() calls?⌄
MCQ-71A SPA at `https://www.example.com` calls its API at `https://api.example.com` with `fetch(..., { credentials: 'include' })`. The API sets the session cookie as `Set-Cookie: sid=8f2c; Domain=example.com; Path=/; Secure; HttpOnly; SameSite=Lax`, and login works. A security review finds the same cookie arriving at the marketing site `blog.example.com` and at three other subdomains, and requires that only `api.example.com` receive it. Which change meets that requirement without breaking the SPA's API calls?⌄
MCQ-3A product dashboard's first paint fans out from the browser to 16 internal microservices. Each fetch sends a custom Authorization header, so every call is preceded by a CORS preflight; first paint p95 is 735 ms. Nine of the services return different Access-Control-Allow-Origin values, and the one widget whose service rejects the dashboard's origin renders empty while the rest paint. The product team can only change its own code this sprint. Which change fixes the empty widget and cuts first paint?⌄
MCQ-6An API at api.example.com serves account JSON to the SPA at app.example.com. Every request carries a session cookie (fetch with credentials: 'include') and a custom X-Client-Version header, so the browser sends a preflight first. The API answers with Access-Control-Allow-Origin: https://app.example.com, Access-Control-Allow-Credentials: true, and Vary: Origin. A partner integration at partner.example.com must now read the same endpoint with the same cookie and the same custom header. Which change keeps the contract correct?⌄
MCQ-97An SPA at https://app.example.com calls the shared API at https://api.example.com/orders with fetch(url, {credentials: 'include', headers: {'Content-Type': 'application/json'}}). The API logs 200 for every call, but the browser blocks the response, and the same API must keep serving a partner's browser app at https://partner.example.com. Which change to the API's response headers fixes the SPA without letting unrelated origins read the credentialed response?⌄
MCQ-5Your API authenticates with a session cookie scoped to .example.com, and users can publish pages at userpages.example.com. A pentest changed a victim's password with a form POST from a page on userpages.example.com. Which fix is defensible?⌄
MCQ-82Acme's dashboard is embedded as an iframe by exactly one partner portal, partner.example, and its session cookie is set `SameSite=None; Secure` so it is sent inside that embed. A researcher frames the dashboard's settings page on evil.example in Chrome; the cookie is sent, and clicks on the framed page fire authenticated `POST /api/settings/email` calls: 12 address changes in under a minute. The API returns JSON with no framing headers. Which change stops the attack while keeping the partner embed working?⌄
MCQ-70A checkout page at https://shop.example.com embeds a fraud-check widget in an iframe whose src is http://widget.fraudco.com/embed. FraudCo has no HTTPS endpoint and no date for one. After the cutover the iframe is blocked as mixed content and every checkout stalls at the fraud step. The team must restore checkout this week without dropping TLS on the page. Which change restores the widget?⌄
MCQ-64Edge middleware runs on every request (`matcher: ['/(.*)']`) and returns 401 when the session cookie is missing. The cookie is set with `Domain=app.example.com`. Content-hashed build output is served from `cdn.example.com`, a host shared with other tenants; user uploads are served from `app.example.com/static/uploads/` and must require a session. Build filenames change on every deploy. Anonymous HTML is 40% of traffic and the origin is already at capacity. After the last deploy, `/app` returns 200 for logged-in users but `/static/build/main.9f2c.js` returns 401, blanking the app for 64% of logged-in users. Which change makes the script load for logged-in users while `/app` still redirects anonymous visitors and uploads still require a session?⌄
MCQ-26A storefront serves a product page through three caches. The CDN edge caches the anonymous HTML with s-maxage=120 and passes any request carrying a session cookie straight to the origin. The origin's Redis caches the signed-in HTML keyed by user id with a 20 s TTL. The page takes 250 requests/s: 200 anonymous and 50 signed-in. The CDN object for this URL was stored at t=0, and at the same instant a price change is written to the database; the write path deletes the affected Redis keys but does not purge the CDN. How many requests are served the old price before it clears?⌄
MCQ-31A retailer's product page is served through a CDN. The origin returns the HTML with `Cache-Control: public, s-maxage=600`, and the HTML embeds a "Recently viewed" rail rendered from the session cookie. The CDN's cache key is the request URL alone. At 12,000 requests/min the edge hit ratio for this URL is 97%. Shoppers report seeing other shoppers' recently viewed items. An engineer proposes adding `Vary: Cookie` to the response. What does that change?⌄
MCQ-37A category page renders 24 product photos, each in a 300 px-wide grid cell on a 2× DPR phone. Every `<img>` points at the 3000×2000 JPEG original (2.4 MB) and CSS scales it to 300 px. The CDN caches the originals with a 30-day TTL; it also supports on-the-fly resize and format conversion via URL parameters, which the team has not turned on. First-view LCP is 6.8 s and the page pulls 57.6 MB of images. A 600 px WebP variant of each photo is 48 KB; a 1200 px variant is 96 KB. The team can change the markup and the CDN configuration, but cannot add or re-encode files at the origin. Which change brings first-view image bytes under 2 MB?⌄
MCQ-51A single-page app calls `GET /api/me` once on page load and reads `user.name`; it caches nothing. The bundle is served with `Cache-Control: max-age=3600`, so a browser that has loaded it keeps that copy for up to an hour without revalidating. The team wants to rename the field to `displayName`. The API deploys instantly; a new bundle takes 6 minutes to reach every CDN edge. The site serves about 1,200 page loads per minute. The proposed plan: deploy the API change (remove `user.name`, add `displayName`) first, then the bundle 6 minutes later. What should the reviewer conclude?⌄
MCQ-55An SPA ships blue-green. `index.html` is served `Cache-Control: no-store`; code-split chunks are content-hashed and served from one shared CDN bucket with `Cache-Control: public, max-age=31536000, immutable`. The pipeline uploads the new build's chunks, flips the load balancer, then deletes the previous build's chunks. In the 9 minutes after the last flip, 31% of sessions that already had a tab open got a 404 on a lazy-loaded chunk. Session telemetry puts the median tab lifetime at 6 hours and the p99 at 3 days. Which change removes the 404s at their cause?⌄
MCQ-72A SaaS app has 42 marketing pages and 18,000 /app/dashboard URLs in Google's index. Anonymous GET /app/dashboard returns 200 HTML with the customer's first name in the title. robots.txt disallows /app/. The team removes the robots.txt disallow, returns 401 for anonymous requests, and adds noindex to authenticated app HTML. What happens over the next 5 weeks?⌄
MCQ-39A video service enqueues a transcode job and returns 202 with a job id. The client polls GET /jobs/{id} every 3 s and, the moment it reads status "ready", GETs the artifact URL from the same response. The worker sets status = "ready" in Postgres and then uploads the artifact to object storage; that upload takes a p99 of 2.1 s. About 4% of jobs 404 on that first artifact GET, and a manual retry a few seconds later always succeeds. Which change fixes the 404s?⌄
MCQ-27A product-list endpoint renders 48 cards. On a cold cache its p95 is 3.4 s. The trace shows one 15 ms query that loads the 48 product rows, then 48 sequential queries that each fetch one related row at about 68 ms each; the query log puts under 1 ms of that 68 ms inside the database, the database team has capped this service's connection pool at 5, and the endpoint's SLO is p95 under 500 ms. Which change should the team ship first?⌄
MCQ-36An inbox list virtualizes to 20 DOM rows. The API still returns 500 messages of 8 KB each per page: 4.0 MB, gzipped to 480 KB on the wire. After virtualization, DOM nodes fell from 500 to 20, but time to interactive only moved from 5.1 s to 4.6 s and the tab holds 62 MB of parsed rows. The budget is 1 s TTI and 30 MB heap on a 4× throttled device, and scrolling must not stall at the end of the loaded rows. Which change meets the budget?⌄
MCQ-29Checkout for SKU A1 is one request: SELECT qty FROM inventory WHERE sku = 'A1'; if qty > 0, charge the card (900 ms p99); UPDATE inventory SET qty = qty - 1 WHERE sku = 'A1' AND qty > 0; INSERT the order. A1 has 50 units. During a flash sale 120 checkouts for A1 arrive within 100 ms and all run their SELECT before any UPDATE commits. When the burst drains, how many units are oversold and how many customers are charged with no stock?⌄
MCQ-23A ticket API stores a version integer per row. `GET /tickets/42` returns `ETag: "7"`. Two tabs load the ticket. Tab A `PUT`s with `If-Match: "7"` and gets `200` with `ETag: "8"`. Tab B, still holding `"7"`, `PUT`s with `If-Match: "7"` and gets `200` with `ETag: "9"`: its note overwrites A's. The handler reads the row, writes the body, and increments the version. Which change makes tab B's `PUT` return `412` while tab A's still returns `200`?⌄
MCQ-8Checkout service: the mobile client POSTs /orders with a client-generated idempotency key, and the orders table has a unique index on idempotency_key. The handler runs SELECT id, response_body FROM idempotency WHERE key = $1; if no row comes back it inserts the order and the key row, then commits. Handler p99 is 1.8 s, and the client retries any POST that has not answered in 1 s. Last week 1,655 orders were inserted twice, and in every duplicate pair the two requests arrived within 400 ms of each other. Which change removes the duplicates?⌄
MCQ-43A field app queues inspection writes in IndexedDB and flushes them when connectivity returns. Each queued record stores only the payload; the idempotency key is generated inside the send function, so every retry of the same record carries a new key. The server upserts on that key. A device queued 73 inspections. The first flush committed 40 rows and then timed out at 30 s; the client, having no ack, retried the full batch twice more, and both retries completed. How many inspection rows does the server hold for that device?⌄
MCQ-9An offline-first notes app mints a UUIDv4 in the client for each 'new list' tap and POSTs it to `/lists`; when the response is lost the client retries with the same UUID and expects its row back. The handler runs:
```sql
INSERT INTO lists (id, owner_id, title)
VALUES ($1, $2, $3)
ON CONFLICT (id) DO UPDATE
SET title = EXCLUDED.title,
owner_id = EXCLUDED.owner_id;
```
`id` is the primary key and holds the client UUID. Support finds 63 lists across 2 accounts now showing another user's title; the UUIDs had been visible in a screenshot of a debug log. Which change fixes the overwrite and keeps the retry returning the caller's own row?⌄
MCQ-30Profile edits POST to a primary Postgres; the profile GET is served by a read replica with replication lag of p50 120 ms and p99 1.6 s. The save handler returns the updated row with `version: 12`, and the client refetches 400 ms after the mutation resolves. About 7% of editors see their previous bio, assume the save failed, and submit again, creating duplicate bios. The primary is already at 85% CPU and the team has ruled out serving profile reads from it; the write path must stay under 50 ms p99. Which change removes the duplicate submissions?⌄
MCQ-41A settings page writes through the primary and renders the saved values on the next request. Under load the next GET lands on a replica 2.8 s behind, the page shows empty defaults, and 310 users re-saved and overwrote later edits. The read path is server-rendered with no client retry, the row is also read by a second tab and a mobile client, and replica lag spikes under load with no fixed bound. Which change makes the next read show the saved values?⌄
MCQ-1A grocery checkout hydrates its cart store once when the page loads and renders the total from that store. The submit endpoint charges the total the client sends. A promotion job rewrites cart-row prices every 15 minutes. Last week 187 orders were charged a total that differed from the cart row's total at submit time; every one came from a tab open longer than 10 minutes, and orders submitted within 10 seconds of load matched. Which change removes the mismatch?⌄
MCQ-20A cookie-authenticated SPA keeps the signed-in user in memory per tab and polls /session every 5 minutes; logout POSTs to /logout, which deletes the Redis session row and clears the cookie. In a canary with 4 tabs open per user, logging out in tab A left 361 other tabs painting the user's name for a median 26 minutes, and 21 users hit 401 on Post and filed 'site is down' tickets. The team will ship only a change that makes every open tab render the logged-out view within one second of the logout response, without raising request volume to /session, which already serves 3k rps. Which change meets both constraints?⌄
MCQ-13Checkout is gated by the flag `instant_payout`. The web app fetches flag values once at page load and does not re-fetch until the page is reloaded; the API evaluates the same flag live on every request. Timeline: 14:00 the flag is enabled for 100% of users; 14:04 ops disables it after the payment provider degrades; 14:06 ops re-enables it. User A loaded the page at 14:02 and taps 'Instant payout' at 14:05. User B loaded the page at 14:05 and taps at 14:07. The button is rendered from the page-load values. What does each user observe?⌄
MCQ-42A shared SPA serves several tenants from one bundle. After a user switches from tenant A to tenant B in the same tab, the invoice table still renders tenant A's 12 invoices. DevTools shows no request to /api/invoices on the switch: the table repaints without any network call. A hard reload fetches 86 rows, all tenant B's, and renders correctly. Which change removes the leak?⌄
MCQ-21An SPA matches /projects/:id with a client-side router. The route component runs:
```js
useEffect(() => {
if (projects.loaded) fetchProject(id);
}, [id]);
```
`projects.loaded` is set true only by the list fetch that runs on /projects. Support reports 2,275 shared links opened cold last week that sat on the skeleton and never painted. A user opens /projects/8f3a in a browser with an empty cache and no prior session. What does the API receive for that open, and what does the user see?⌄
MCQ-22A product search box fires a request on every keystroke. At peak the server logs 1,900 overlapping in-flight searches per hour, 38% of rendered results belong to a query string the box no longer shows, and after back navigation the URL reads q=wireless+headphones while the box shows wireless head. Ranking and paging live on the server; the catalog is 4M SKUs. Which change fixes all three symptoms?⌄
MCQ-40A postmortem finds that posting one comment to a 40-participant thread makes the authoring browser issue 40 POSTs; 6 time out, those participants never see the comment, and the write path p95 rises from 90 ms to 1.7 s. The comment must commit in a single write regardless of participant count, and participants must be notified even when they have no page open. Which change addresses the cause?⌄
MCQ-24A payments provider POSTs a signed webhook to your API for every successful charge. The handler currently fans the event straight out to WebSocket connections and writes nothing. The API runs 6 instances behind a load balancer, and the socket gateway restarted for 22 minutes last Tuesday. In that window 3,400 webhooks arrived, no badge appeared, and 205 users paid a second time because their invoice screen still read unpaid. The provider retries a failed delivery 3 times over 15 minutes, then drops the event. Which change makes the badge correct for a client that was offline when its webhook arrived?⌄
MCQ-25`api.example.com` serves a React web app (cookie session) and an iOS app (bearer token from `POST /auth/token`; the app stores no cookie). `GET /v1/orders?limit=20&cursor=<opaque>` returns 20 orders plus a `next` cursor. The tenant has 240,000 orders and the API caps `limit` at 100. The web app pages correctly: rows 1–20, 21–40, 41–60. The iOS app gets rows 1–20 on every page: each response carries a new `next` value, the app returns exactly the cursor it received (server logs show it byte-identical), and every iOS request logs `SELECT ... ORDER BY id OFFSET 0 LIMIT 20`. The cursor store is shared by all six API replicas, and the web app pages correctly from any of them. What should the team change?⌄
MCQ-38An orders API serves CSV export from the web UI. The endpoint runs the query inline and streams rows to the browser. A 620,000-row export takes 94 s; during it, checkout p95 rises from 180 ms to 2.4 s. The pool is 20 connections and all 20 are held by export requests for the full 94 s, while the export query itself uses 1.2 s of CPU. The load balancer closes any connection at 30 s, so the browser receives a truncated file. At peak, 20 exports are launched within a minute. Which change fixes both the truncated download and the checkout regression?⌄
MCQ-15Profile photos run up to 95 MB. The current path POSTs the body through the API service, which runs on 512 MB instances behind a 30-second gateway timeout; during launch, 48 uploads failed with 413 and the retry button re-sent the same body through the app server. The API must remain the only holder of storage credentials, must record a metadata row per photo, and the UI must not show the upload as done until that row exists. Which design is right for this situation?⌄
MCQ-16A live incident dashboard has 12,000 concurrent viewers. Each browser polls GET /board every 2 s. At peak the origin runs at 68% CPU and p95 time-to-fresh-pixel is 2.1 s. The product now requires p95 under 500 ms for the 300 viewers in the active incident room; the other 11,700 viewers are passive and tolerate 5 s. The server already has a pub/sub channel that can push to a room. Which change should you make?⌄
MCQ-19A search endpoint enforces 120 requests/min per API key. The web typeahead, the iOS app, and a nightly export job all send that key. Last week the web client ignored 429 and retried at once: 6,200 extra searches, and the origin spent 13 minutes serving nothing else. The endpoint's Retry-After is 30 seconds. Which proposal should the reviewer accept?⌄
MCQ-49Autocomplete on a 4-million-row catalog fires one query per keystroke from the browser. At peak, 2,400 users type at once; the API issues 11 requests per second per user, 26,400 queries per second reach the primary, and its CPU sits at 92% with search p99 rising from 40 ms to 180 ms. The load is uniform across users, the catalog is re-indexed hourly, prefixes are long-tailed, and no new replica can be provisioned before the launch in two weeks. Which change should the team ship?⌄
MCQ-28A dashboard service renders 9 tiles; each tile query joins 4 fact tables, and p95 first paint is 6.8 s. The team adds a dashboard_summary table with 9 counter columns, rebuilt by a nightly job at 02:00, and first paint drops to 90 ms. Two weeks later a user closes an incident at 09:00 and the tile still shows it open at 17:00; on a day when a deploy failed the 02:00 rebuild, the summary served the previous day's counters with no error surfaced. A tile must reflect a source write by the next paint in the same session, and a failed rebuild must never be served silently. Which change meets both requirements?⌄
MCQ-50Insights' first paint runs a 14-table join over 18 months of a 90-million-row facts table. p95 first paint is 30 s and the gateway aborts the request at 30 s. The page must paint in under 1 s and still answer arbitrary date ranges. A nightly summary of the same data holds 12,000 rows and serves in 400 ms. Which change meets both requirements?⌄
MCQ-33A product is going live. Its in-app usage page is built from client analytics events landed in the warehouse; invoices are generated from the billing ledger. For one tenant the usage page reads 1.8M events while the ledger holds 1.41M billable rows, and 64 customers have disputed the gap. Which approach should the team accept?⌄
MCQ-35An erasure request is processed at T=0: the users row is deleted, the API returns 404 for that id, and a CDN purge is issued. At T+3 days two exposures remain. A teammate's people picker still lists the person; the picker is served from a search index that is fully rebuilt from the users table every 14 days, last rebuilt at T−2 days. The erased user's laptop, offline, still renders the full profile from the SPA's IndexedDB cache, which the app treats as fresh for 21 days after the last successful fetch; that fetch was at T−1 day. The CDN TTL is 60 s and read replicas lag under 1 s. With no further action, when does the last of the two exposures end?⌄
MCQ-45An events service stores each occurrence as a UTC instant in `timestamptz` plus an IANA zone name, and schedules a weekly series by adding 604800 seconds to the previous occurrence's UTC instant. A 09:00 America/New_York standup fires at 10:00 New York time from 2024-03-10 until 2024-11-03; a 09:00 Europe/Paris standup is off by an hour from 2024-03-31 until 2024-10-27. Which change makes both series fire at 09:00 local year-round?⌄
MCQ-46A checkout API returns line items in integer cents and a grand total. The web client computes tax per line, rounds each line's tax half-up to the nearest cent, then sums; the server computes tax on the subtotal and rounds once. For a cart of three items at 1299 cents each with an 8.875% tax rate, the client displays 4242 cents and the server writes 4243 cents to the ledger. The API contract says the server is the only component that computes tax; clients display returned totals. Finance requires tax on an invoice to be computed on the taxable subtotal and rounded once. Which change makes the client and the ledger agree?⌄
MCQ-44An orders API recomputes the charge from the stored line items instead of charging the total the client posts. One order has line items of 2 × $20.00 and 1 × $45.00. A 15% coupon applies to the subtotal, then 8% sales tax applies to the discounted subtotal. The web client posted its own total of $61.41. What does the customer get charged?⌄
MCQ-90A checkout computes sales tax in two places. The order API rounds tax per line item to the nearest cent and sums the rounded lines; the React checkout sums the exact line amounts and rounds the total once. For an order of three $19.99 items at 8.875% tax the API returns $5.31 and the UI shows $5.32, and the same one-cent gap appears on about 12% of multi-item orders. A mobile app and a partner API also compute tax client-side, and finance reconciles payouts against the API's invoice of record. What is the correct fix?⌄
MCQ-17A product page server-renders a member-price badge. The server reads the httpOnly `member` cookie and renders `$79`; the client's first render reads `localStorage.getItem('member')` and renders `$99`. React 18 logs a hydration error on 1,240 sessions a day, and because a failed hydration makes React discard the server HTML and re-render the whole root on the client, LCP on those sessions goes from 1.1 s to 2.4 s. The badge has to stay in the server HTML: rendering it only after mount was measured at a 220 ms pop-in. Which change fixes the mismatch?⌄
MCQ-18A product detail screen on mid-range Android phones renders in 1.2 s TTI from four REST calls (product, price, reviews, inventory) issued in a waterfall, 26 kB total. A rewrite to a single GraphQL query returns 190 kB: the product resolver resolves the whole catalog node, including 40 review edges the screen never renders, and TTI rises to 2.6 s. The team ships next week. Which change best fixes the regression?⌄
MCQ-54A cart API returns `items`. A deploy renames it to `lineItems` and drops `items` from the response, gated to 20% of sessions by session ID. Bundle 3.x, 80% of active sessions, reads only `items` and renders an empty cart when the field is absent; bundle 4.x reads `lineItems` and falls back to `items`. Canary assignment is random with respect to bundle version. While the canary runs, what share of all sessions renders an empty cart?⌄
MCQ-7A team's API serves a first-party SPA whose bundles are CDN-cached for 7 days and whose tabs stay open for weeks, plus a partner that pins one version and ignores unknown fields. This quarter the team must add two fields, change one field's type, and remove one field; each additional live version costs a full regression pass per release. Which justification for their versioning handling is sound?⌄
MCQ-57A product ships its SPA bundle and its API as separate deployables. This release removes two endpoints the current bundle calls and adds one endpoint the new bundle calls. The team must be able to roll back either side alone during the first 24 hours after launch. Which release practice should they adopt?⌄
MCQ-14A payments platform keeps `schema/openapi.yaml` as the single source of truth. The web app generates its TypeScript types from that schema inside `npm run build`, and the generated files are not committed. The Go API hand-writes its request structs and validates bodies against the schema at runtime. The iOS app hand-writes Codable structs in a separate repo. An engineer renames `amount_cents` (integer) to `amount` (string) in the schema and merges to main; the web checkout screen reads `payment.amount_cents`. CI builds web, API and iOS from that commit. Where does the mismatch surface first?⌄
MCQ-76A React checkout page and a Go list API share one repo. Every PR runs 410 unit tests (4 minutes) and 6 browser journeys (18 minutes); there are no contract tests. Last month the API renamed `amount` to `total`, every suite stayed green, and checkout rendered blank totals for 14% of sessions for two hours. The team has a 10-minute PR CI budget and wants a payload rename to fail before merge. Which change to the suite achieves that?⌄
MCQ-77A payments service is covered by 22 MSW-backed journeys in CI, all green. The same 22 run nightly against staging: 15 pass, and 7 fail with HTTP 409 and `duplicate key value violates unique constraint "payments_idempotency_key_key"`. Each of the 7 journeys POSTs /payments twice with the same `Idempotency-Key` header to exercise the retry path, and the MSW handler returns 200 with the same payment body for both calls. The service's contract, checked into the repo as an OpenAPI document, states that a repeated POST with the same key returns the original payment with 200, and the unique index on payments.idempotency_key has existed since the table was created. Which change should the team make?⌄
MCQ-78A checkout service runs two CI gates. The contract suite validates `GET /api/card` against a JSON Schema that marks `imageUrl` as required and `type: string`. The visual suite screenshots the desktop cart page at 0.1% pixel tolerance. A release candidate changes the card service to omit `imageUrl` when no image is stored. CI reports the contract suite red on `imageUrl` missing and the visual suite green. Two days later, 31% of mobile checkout sessions render a blank hero. Which conclusion does this evidence support?⌄
MCQ-95A team is adding "archive project" to a SaaS app. The API spec (14 pages) and the UI spec (11 pages) were approved separately. Three weeks into implementation the first end-to-end run fails twice: the UI posts `projectId` as a JSON string while the handler parses an integer, and the archive endpoint returns 200 but the project still shows in the list because the handler sets `status = 'archived'` while the list query filters `archived_at IS NULL`. Which single change to the design doc would have surfaced both mismatches before implementation started?⌄
MCQ-98A payments API is handed to a new team. Its `status` field is an enum read by a web client, an iOS client, and a nightly reconciliation batch job. The handoff doc lists endpoints and screen names but contains no example payloads. Six weeks later the API adds two `status` values: web ships a fallback and renders fine, iOS decodes into a closed enum and crashes for 4% of users, and the batch job maps unknown values to null and has dropped 1,200 records. Which handoff artifact would have surfaced both failures before the deploy?⌄
MCQ-88Two engineers pair on a refund-status ticket that touches the Python `orders-api` handler and the TypeScript `orders-web` page. They split by folder: the handler merges Tuesday, the page merges Thursday. On Thursday every order shows 'pending' because the handler serializes the enum as `REFUND_PENDING` while the page compares against `pending`; reconciling the two takes 11 days against a 3-day estimate. The next ticket of the same shape is queued. Which change to how the pair works would have caught the mismatch before Thursday's merge?⌄
MCQ-93A backend specialist owns the payments API; the checkout web client belongs to another team. Over 8 weeks she shipped 11 API tickets, and 5 of them caused blank-screen incidents in checkout: each a 200 response with a renamed field the web client rendered as nothing. Every ticket needed two handoffs (API review, then web review) and the median API-merge-to-working-checkout was 6 days. The web team is at capacity this quarter and the payments roadmap cannot slip. Which mentoring move fits?⌄
MCQ-100A team keeps a web client and an API in one repo, with a shared `types` package both import. CI runs the full suite on every PR and takes 42 minutes. Last month 240 PRs merged: 168 touched only one half, 72 touched both. The API deploys about 14 times a week, the web about 3. Two contract breaks last quarter were both caught by the shared type check in CI. What should the team do first?⌄
MCQ-94A team is sizing a 'change plan' feature for a billing app. The designer's mockup shows one screen and the happy path. The API route `POST /subscriptions/{id}/plan` is a stub that returns 501. The `subscriptions` table has no `plan_id` column and holds 40k live rows. Nothing reads the old `plan` field: the mobile client moved to `plan_id` two releases ago and the web client never read it. From the last three features of this shape, the team's actuals were 5 days for the mockup screen, 0.5 day per extra screen state (empty, error, 409 conflict, loading), 2 days for the endpoint handler, 1.5 days for a migration plus backfill, 1 day for contract tests, and 2 days for a dual rollout. Which estimate and scope should the team commit to?⌄
MCQ-96A PR adds a CSV export button to an admin page. The diff changes `ExportButton.tsx` and `reports.py`. The reviewer reads only the React diff and runs the UI locally against a mock API; the button renders and downloads a file. The PR is approved. In production, the endpoint reads `tenant_id` from the query string and returns rows for that tenant without checking the caller's session. The UI builds the query from a `tenantId` URL parameter that any admin can edit. A support engineer changes the parameter and exports 1,200 rows belonging to another tenant. The postmortem says the review never opened the handler. Which review change would have caught this defect before merge?⌄
MCQ-79A checkout form posts to a JSON API. On validation failure the API returns 422 with a body like `{"errors":[{"field":"card_number","code":"invalid_luhn"}]}`. The form draws a red border on each flagged field and nothing else. Screen-reader users report that pressing Submit appears to do nothing. The client can change this quarter; the API cannot. Which change lets a screen-reader user hear why the submission failed?⌄
MCQ-81A product search endpoint binds the free-text `q` as a parameter but builds its `ORDER BY` clause by interpolating the `sort` query parameter, which the UI fills from a five-value dropdown (name, price, rating, stock, newest). A pentest set `sort` to a crafted expression containing no quotes or comment markers and dumped 68,000 customer rows in 9 minutes. Which change closes the hole?⌄
MCQ-80A postmortem traces a stored XSS to the comment body: it is stored raw in Postgres, returned as a JSON string by the API, and assigned to innerHTML by the web comment list, the admin moderation tool, and the mobile WebView. The same column is re-saved by moderators when they edit a comment, and it is exported nightly to a BI tool that renders it as plain text. Which change addresses the cause?⌄
MCQ-34A support dashboard SPA calls GET /api/tickets?include=customer. The API returns each ticket with customer.national_id and card.pan in full. The UI renders only last 4. A session replay tool recorded 11,400 raw national IDs from the API response in client memory, and the browser disk cache kept the JSON for 7 days after the tab closed. The endpoint sits behind a CDN with a 5-minute TTL. The bug report says the UI looks masked. Which change fixes the leak?⌄
MCQ-52A Vite SPA is built in CI with `VITE_DB_PASSWORD` set in the build environment and deployed to a CDN; the Node API reads `DB_PASSWORD` from a Kubernetes secret at runtime. After a leak report, the team rotates the password in the Kubernetes secret and restarts the API pods. The API authenticates with the new password, but three days later a scanner still finds the old password in the deployed JS bundle. What explains this?⌄
MCQ-65`app.example.com` serves the SPA; the API moved to `api.example.com` last sprint. Production ships `default-src 'self'; connect-src 'self'`. Since the move, writes fail in the browser with `Refused to connect ... because it violates the following Content Security Policy directive: "connect-src 'self'"`, and the API access log shows no matching requests. The client also opens a websocket to `wss://rt.example.com` and posts errors to `https://ingest.example.net`. Go-live is next week. Which approach should the team take?⌄
MCQ-66A payments app embeds its provider's secret key in the client bundle so the browser can call the provider directly. The bundle is served from a CDN with `Cache-Control: max-age=31536000, immutable` and has been live for 9 weeks. The provider's dashboard lists the key as active. The team's remediation: they generate a new key, put it in the server's environment, redeploy the server, and leave the old key active at the provider so in-flight requests do not break. They do not rebuild the frontend. One hour later, what is true of the leaked key?⌄
MCQ-58Your SPA keeps a 30-day JWT in localStorage. A support-chat widget's XSS exfiltrated one token; it was replayed from another ASN for 9 days, and the only revocation lever you had was rotating the global signing key, which signed out all 40,000 users. Product wants sessions that survive a tab close for 30 days, and security wants a stolen credential to be useless within minutes and revocable for one user without touching the other 40,000. Which change delivers all three?⌄
MCQ-73A payments SPA keeps its session token in the address bar: the OAuth callback lands on `https://app.example.com/dashboard?access_token=…` and the router leaves the parameter there for the rest of the session. The same token is sent as an `Authorization: Bearer …` header on every API call. Before launch the team adds a Sentry `beforeSend` hook that deletes `event.request.headers.Authorization`. A week later a security review greps stored events and still finds live tokens. The review also confirms that stored events carry no `Authorization` header, that the leaking events include both `captureException` calls and unhandled errors, that they include page-load errors where no API call was made, and that every one carries the current release tag. Which explanation fits?⌄
MCQ-83An incident review covers a supply-chain compromise that ran for 5 days across 14 services. A publisher pushed `@acme/telemetry@4.2.1` to npm and `acme-telemetry==4.2.1` to the internal PyPI mirror on the same morning. The npm package's postinstall script is written to read `~/.aws/credentials`; the wheel's `setup.py` did the same on the API hosts. The pipeline runs `npm ci`, `npm audit --audit-level=high`, and a lockfile-diff gate against `web/package-lock.json`, and builds the API image with `pip install -r api/requirements.txt`, which pins no versions and carries no hashes. The web lockfile was unchanged across the incident window. The JS scanner reported nothing for the full 5 days. Which statement explains why the JS scanner stayed green?⌄
MCQ-84A landing page's p95 load is 4.2 s. The waterfall shows document TTFB at 1.1 s, the 1.9 MB HTML body taking 2.7 s to download after the first byte, the first API GET running after paint at 90 ms, and the database query behind that API at 12 ms. The team's top ticket is to add an index to that query. What does the waterfall say to do instead?⌄
MCQ-85Traffic grew tenfold last quarter. Field p75 LCP is 4.1 s, INP is 340 ms, and CLS is 0.28. The API's p75 response time is 70 ms. The team has a capacity ticket open to scale the database because they blame the API. Which next step is defensible?⌄
MCQ-86A payments service handles POST /charges with this code (Python 3.12, psycopg 3, connection in autocommit mode; `charges` has a unique index on `idem_key`):
```python
row = cur.execute(
"SELECT gateway_id, amount FROM charges WHERE idem_key = %s", (key,)
).fetchone()
if row:
return row
capture = gateway.capture(amount) # p99 1.4 s
cur.execute(
"INSERT INTO charges (idem_key, gateway_id, amount) VALUES (%s, %s, %s)",
(key, capture.id, amount),
)
return capture
```
The mobile client sends a stable `Idempotency-Key` per checkout, aborts the request at 1.0 s, and retries once. The first attempt reaches the handler at t=0 and its gateway call runs until t=1.4 s. What does the retry produce?⌄
MCQ-87A tenant reports that the /orders list page takes about 1.8 s. The HAR captured from the failing load holds one entry: GET /orders, status 200, 1.8 s, with 60 rows in the response body. The database query log filtered to that request id holds 541 statements. What does joining the HAR entry to the query log lines on request id establish?⌄
MCQ-74An e-commerce product page is server-rendered. Each HTML request makes 22 downstream API calls: product, inventory, pricing, recommendations, reviews, and 17 others. At 2.8M views/month, p95 render is 3.4s and this route alone is 41% of the monthly API origin bill. The first screen must show the signed-in user's cart and live inventory, so the HTML response cannot be cached. The team must cut p95 below 1s and halve this route's origin cost. Which change best meets both targets?⌄
MCQ-59A BFF runs 12 pods behind a load balancer that routes only to pods passing readiness. Readiness and liveness both probe GET /healthz, which returns 200 whenever the process is up; both run every 5 s with failureThreshold 3. The product page is 92% of traffic and calls the session store and the catalog API on every render; checkout is the other 8% and additionally calls the payments API. The page's render budget is 800 ms; the session store's p99 is 40 ms and the catalog API's p99 is 120 ms. Last Tuesday the session store was unreachable for 13 minutes: all 12 pods stayed Ready, the balancer kept routing, and first-page success fell from 99.4% to 28%, with every request that reached the BFF failing. A pod restart takes 45 s to warm its connection pool. Which change should the team ship?⌄
MCQ-63A Node.js service runs SSR and the JSON checkout API in the same process on 8 pods, each with 4 vCPUs. During a flash sale the service receives 12,000 HTML requests/min and 4,000 JSON checkout requests/min. Metrics show render queue delay 7 s, checkout p95 6.2 s, CPU 95% on every pod, and event-loop lag 1.8 s. The team doubles the fleet to 16 pods. Render queue delay falls to 3.5 s, but checkout p95 stays at 6.1 s. Which conclusion fits these numbers?⌄
MCQ-60Checkout p99 is 4.8 s. Web blames the API, the API blames the database, and the incident reproduces only in production under load. Each team's dashboard shows its own slice as healthy. Which instrumentation do you add first?⌄
MCQ-61A checkout page's backend APM reports POST /checkout at p95 180 ms. RUM for the same route reports p95 1.8 s on desktop and p95 6.4 s on mid-range Android. The page ships a 2.1 MB JavaScript bundle. Which diagnosis does this data support?⌄
MCQ-62A checkout journey runs three server calls (cart fetch, payment authorize, order write) then renders a confirm screen. Last week: 200,000 checkout attempts; cart API availability 99.95%, payment API 99.97%, order write 99.99%, each meeting its own SLO; 760 attempts never reached the confirm screen. The team wants one change that would have caught the loss. Which?⌄
MCQ-89A checkout service ships its web bundle and its API as separate artifacts, and one on-call engineer carries the pager for both. Paging is wired to two signals: API 5xx rate above 1% for 5 minutes, and frontend JS exception rate above 5% for 5 minutes. Last Tuesday a bundle deploy started reading a field the API had stopped returning. The API kept answering 200 with an empty `items` array, the bundle's `catch` rendered an empty cart, frontend exceptions stayed at 0.1%, API 5xx stayed at 0.02%, and checkout conversion fell from 4.1% to 0.6% for 74 minutes until a customer tweeted. The team wants the next occurrence to page within 5 minutes. Which change does that?⌄
MCQ-91A checkout journey SLA of 99.9% (successful click-to-confirmation journeys ÷ attempted journeys) fell to 99.2% over an 11-hour window. The API dashboard stayed at 99.95% of requests returning 2xx and the web client dashboard at 99.98% of page loads rendered, so neither half paged. API p99 latency rose from 120 ms to 900 ms and the 20-connection pool saturated. Client logs show every 502 retried up to 5 times with no backoff. Which action should the team take first?⌄
MCQ-75At 14:02 the cart API deploy changes `GET /cart` to return `{items:[...]}` instead of `{cart:{items:[...]}}`. Checkout conversion falls from 99.6% to 89% within ten minutes. The web tier dashboard shows 100% 2xx; the API dashboard shows 0.02% 5xx and p99 180 ms. Tickets come only from users whose browser has been open since before 14:02; a HAR from one shows the app parsing the response, getting `undefined`, and rendering an empty cart. Which action should the incident commander take?⌄
MCQ-53A team runs 40 concurrent PR previews at pr-<number>.preview.example.com. CI builds the frontend with VITE_API_URL from the repo variable API_URL, which is still https://api.example.com. The preview API at https://api.preview.example.com is a fork of production API; its /checkout handler reads PAYMENTS_URL and falls back to https://payments.example.com when unset, and the shared preview API deployment leaves PAYMENTS_URL unset. Last Tuesday PR #1842 changed checkout button copy; its preview page posted to production API and created 27 charges against 19 real customers. The requirement is that no preview deploy can write to production data, even if a PR changes config or adds a new route. Which change set is sufficient?⌄
MCQ-56A payments service reads the `refunds_enabled` flag from a flag service. The admin web UI polls flags every 15 s; the mobile app caches them for 24 h; a reconciliation job calls `POST /refunds` directly and never reads the flag. During an incident an on-call engineer sets `refunds_enabled=false`. The admin UI hides the Refund button 15 s later, but over the next 8 minutes 387 refunds are created: 41 from the admin UI before its poll, 96 from mobile clients with cached flags, and 250 from the reconciliation job. Which change would have reduced the 387 refunds to 0?⌄
MCQ-68Your team of 14 runs a preview environment per PR, a container plus a preview API, and every preview points at the same shared `staging` Postgres. Last Tuesday, PR #812 (which adds `ALTER TABLE users DROP COLUMN legacy_plan`) and PR #815 (whose account page still selects `users.legacy_plan`) were open at the same time. The #815 preview began returning 500s on `/account`, and the nightly staging refresh failed with `column "legacy_plan" does not exist`. Production was unaffected. What is the correct fix?⌄
MCQ-67A static site (S3 + CloudFront) and its API (ECS behind an ALB) ship from two Terraform workspaces, `web` and `api`. The `web` workspace reads the API hostname from `api`'s remote state and bakes it into the browser bundle at build time; CloudFront serves that bundle with a 24-hour TTL. On Tuesday the `api` workspace was applied first and replaced the ALB, changing its DNS name from `alb-1` to `alb-2`. The `web` workspace was applied 40 minutes later. For those 40 minutes the live site served the cached bundle pointing at `alb-1`: reads stayed up (they go through a stable read hostname), but 100% of writes from the live site hit the decommissioned ALB and failed. Which change to the Terraform layout removes this failure mode?⌄
MCQ-69Traffic grew tenfold. The checkout HTML is served from a CDN edge cache and the JS bundle is cached in the browser for 24 hours; the API sits behind the same edge, which can vary its cache on a cookie. The new bundle calls a new API contract, and guest checkout carries no user ID. Last rollout, a 5% random sticky canary put 40,000 sessions on the candidate, conversion dropped 19%, and 2,200 clients stayed on the broken pair until their cookie expired. You need a canary whose blast radius is bounded to a cohort you control, whose pull-back reaches a browser that already cached the bundle, and that keeps HTML and API on the same pair. Which method is defensible?⌄
MCQ-47An engineer is asked to justify their handling of inventory reservation from the product page. The product is a limited run that sells out in seconds, checkout takes 3–5 minutes because the payment provider redirects for 3-D Secure, and about 60% of started checkouts are abandoned. Which design should they defend?⌄
MCQ-48Product search returns 20 hits per page from a 40,000-document index, of which 2,000 are red. The color facet is applied in the browser to the 20 hits the query already returned, so a red-filtered search shows about one item and comes back empty in roughly a third of cases. Which change removes the cause?⌄
MCQ-32A storefront's typeahead sends the user's input unchanged as a `match` query to Elasticsearch 8.13, where the `catalog` index maps `title` with `"analyzer": "whitespace"` and holds 12,400 products. Typing `Widget A-19` returns the product; typing `widget a-19` returns nothing, and support has 40 tickets this week from users who typed a product name in lowercase. Which account of the failure is correct?⌄
MCQ-92You are in a behavioral interview. The interviewer asks: "Tell me about a time you refused a client-only shortcut." Your notes from the incident say: Product asked for a 3-day client cache on the profile save page to hide a 409 from a unique email constraint. You refused the cache, returned the 409 to the labelled email field, and spent 9 days binding the constraint to the form. After launch, 4,200 writes that would have shown "Saved" were rejected, and a refresh matched the row. Which STAR answer should you give?⌄
MCQ-99A retail team's web SPA renders the order-detail screen by calling three services directly from the browser (orders (p75 80 ms), inventory (p75 70 ms) and pricing (p75 60 ms)) in parallel, so the screen's p75 is 80 ms against a 150 ms budget. Each call carries a service token that the SPA reads from its JavaScript bundle. iOS, Android and a partner API call the same three services directly. The team proposes a BFF in front of the web SPA only (one call, parallel fan-out, merged payload, tokens held server-side) and asks the reviewer to vote it into trial. Measured BFF p75 is 95 ms. Which decision should the reviewer make?⌄