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-2A payments API answers HTTP 200 for every response and puts the outcome in the body: {"ok": false, "error": "upstream_unavailable"} when the card processor is down. The client SDK retries only on 5xx and 429, and the circuit breaker counts only 5xx. During a 40-minute processor outage the API answered 12,400 charge attempts that way: no retry fired, the breaker never opened, and each failed charge was shown to the user as a decline. Which change removes this class of failure?⌄
MCQ-7A refunds service handles `POST /refunds`. The handler reads the JSON body, inserts a row into `refunds`, then calls the payment provider. A client sends `{"amount": 12.5, "currency": "US"}`; `US` is not in the supported set (`USD`, `EUR`, `GBP`). The insert commits, the provider call raises `UnsupportedCurrency`, the handler returns 500, and the row stays. Over a week 340 such rows accumulate and the nightly reconciliation job double-counts them. The team wants this class of request to return a 4xx and leave no row in `refunds`. Which change does that?⌄
MCQ-4An export job pages through a 1,000-row `events` table with `SELECT * FROM events ORDER BY created_at DESC LIMIT 100 OFFSET n`. It reads `COUNT(*)` once at the start (1,000) and then fetches offsets 0, 100, …, 900. After the first page is fetched, 50 new events are inserted with the newest `created_at`, so they sort to the top. What does the export contain?⌄
MCQ-1A payments team is adding order creation and cancellation to its API. Order IDs come from the billing system's sequence and cannot be chosen by the caller. Three clients (web, iOS, Android) each retry any request that gets a 504 from the gateway, up to three times; last quarter that created 4% of orders twice. Cancellations must record the actor and the timestamp for audit, and two customers can legitimately place identical orders (same items, same amount) within the same minute. Which design should the team ship?⌄
MCQ-97A payments API creates a charge on POST /charges. A client sends the request, the service commits the charge and returns 201, but the response is lost and the client's 2-second timeout fires. The client cannot tell whether the charge exists, so it retries the same request. Which approach guarantees the retry does not create a second charge?⌄
MCQ-3A payments service runs 6 pods behind a round-robin load balancer. Each pod keeps its own in-memory map of idempotency key → stored response, with a 24-hour TTL. The client sends POST /charges with an Idempotency-Key header, retries once after a 30-second timeout, and reads the charge ID from the response body. Over one week, 40 of 9,000 charges were duplicated, and the duplicates cluster in the minutes after each deploy. Which change removes the duplicates?⌄
MCQ-42A payments consumer reads from a queue that guarantees at-least-once delivery. Each message asks for a refund on an order; an order can have multiple partial refunds, so order_id is not unique. During a consumer-group rebalance, 1,200 messages were redelivered, and the handler inserted 1,200 duplicate refund rows. The database supports transactions. Which change prevents duplicate refund rows under redelivery without dropping legitimate partial refunds?⌄
MCQ-5The `/orders` response carries `"total": 1999` (integer cents). Supporting currencies with 3-decimal minor units means `total` has to become a decimal string. Thirty days of access logs show 12 integrations read `total`: 9 deserialize it with a strict integer schema that throws on a string, and 3 read it and ignore the value. Two of the 9 ship on a quarterly train, next release in 11 weeks; the other 7 ship weekly. The team runs one handler and cannot fork it per version. Which plan is defensible?⌄
MCQ-14payments-api v2.14.0 makes `currency` required on `POST /charges`; it was optional in v2.13. The provider's 412 unit tests pass, because they build requests with `currency` set. Four services call the endpoint: checkout-web, mobile-ios and partner-api omit `currency`; billing-batch always sends it. Each consumer's suite runs against a stub pinned to the v2.13 schema, so all four pass. The provider team wants one pre-deploy check that fails the build for exactly the consumers that will break in production. Which check does that, and what does it report?⌄
MCQ-18POST /events accepts a JSON array and inserts every element inside one transaction. Clients send 10,000 events per call. p99 is 4 minutes, the 20-connection pool is fully occupied by these calls, and a malformed event at index 9,000 rolls back all 10,000. Clients need a per-item result for every event in the call, returned synchronously, and a malformed event must not stop the other 9,999 from being stored. Which change fixes the incident?⌄
MCQ-44A payments service commits an order row and then publishes an OrderCreated event to Kafka in a separate call. A deploy killed the process between the two steps; 300 committed orders had no event until an engineer replayed them by hand. The team must remove manual replay while keeping the existing Kafka consumers, which already deduplicate by event id. Which change should they make?⌄
MCQ-43A payments consumer reads a Kafka topic with at-least-once delivery and applies each record with `UPDATE accounts SET balance = balance + ? WHERE id = ?`, then calls `commitSync()`. A broker restart replayed 2,300 records from the last committed offsets, and 41 accounts were credited twice. No credit may be lost or applied twice. Which change makes the replay harmless?⌄
MCQ-45An order service publishes events to a 12-partition topic with the default round-robin producer. After traffic grew tenfold, an older address change overwrote a newer one for 40 customers and shipments went to the previous address. Ordering per entity must hold and throughput must keep scaling with the partition count. Which change is defensible?⌄
MCQ-46A consumer group reads the `orders` topic: 12 partitions, one consumer per partition, each order takes 40 ms to process. A schema change ships a poison message that throws in 15 ms on every attempt. The retry policy is 5 attempts with backoff 1 s, 2 s, 4 s, 8 s, then publish to `orders-dlq`. Each partition feeds 400 events/s downstream. What does the poison message cost?⌄
MCQ-47A nightly invoice job runs as the same cron entry on all 6 app instances, which sit behind an autoscaler and are replaced on every deploy. Last night it produced 6 copies of 4,200 invoices, and each invoice triggers a paid third-party API call. The team is choosing a fix and must justify it. Which justification is sound?⌄
MCQ-48A customer's erasure request is closed after `DELETE FROM customers WHERE id = 42` returns and the API responds 200. Three weeks later the customer's email still appears in the analytics dashboard. The pipeline is Postgres → Debezium CDC → Kafka `user_events` (7-day retention) → Snowflake `events` (400-day retention, stores `user_email` raw). Redis caches the profile for 24 hours; nightly `pg_dump` backups are kept 14 days; the erasure SLA is 30 days. What is the correct next action?⌄
MCQ-26`events` holds 12M rows. Tenant 7 owns 4.1M of them. The last 24 hours contain 40,000 rows across all tenants, 1,200 of them tenant 7's. The table's only index is `events_tenant_status_created_idx (tenant_id, status, created_at)`, built for a different query that filters on `status`. This query runs every 30 seconds:
```sql
SELECT id, created_at FROM events
WHERE tenant_id = 7
AND created_at >= now() - interval '1 day'
ORDER BY created_at;
```
`EXPLAIN (ANALYZE, BUFFERS)` on PostgreSQL 16 reports: `Index Scan using events_tenant_status_created_idx`, `Index Cond: (tenant_id = 7)`, `Filter: (created_at >= ...)`, `Rows Removed by Filter: 4,098,800`, `Sort Method: quicksort 1,200 rows`, `Execution Time: 3,240 ms`. The team wants the plan to read as few rows as possible. Which change achieves that, and how many rows does the plan then read?⌄
MCQ-27A nightly report query takes 46 s in production but 30 ms against a 500-row staging copy. PostgreSQL's EXPLAIN ANALYZE on production shows a nested loop join: the outer index scan on orders.status is estimated at 900 rows but returns 2.4 million, and the inner index scan on customers_pkey runs once per outer row. Which change is most likely to cut the runtime?⌄
MCQ-28An orders endpoint returns 50 orders, each with its line items, and the ORM lazy-loads the line-item association. APM reports 51 SQL statements per request and a p95 of 1.4 s. The database's slow-query log shows every one of those statements executing in under 3 ms, the connection pool of 20 records no wait time, and orders must reflect writes immediately. Which change addresses the latency?⌄
MCQ-35A dashboard shows, for each of a customer's 20 accounts, the sum of `ledger_entries` over a range the user picks: 7 days, 30 days, or the current quarter. The accounts average 1.2 million entries in the selected range. A load takes 310 ms p99 against a 100 ms budget; the plan shows an index-only scan on `ledger_entries_account_id_entry_date_amount_idx`, with 290 ms spent in the aggregate. The primary is at 70% CPU on 16 cores. The dashboard is loaded 40 times/s across about 200,000 customers. The payments API returns the customer's new balance in its own response, so an entry inserted a second ago must appear on the next dashboard load. Which change should the team make?⌄
MCQ-37An orders table holds 12M rows. Each order's status lives inside a jsonb `payload` column next to genuinely variable third-party attributes. The dashboard filters on status and joins orders to a `statuses` lookup table so labels and sort order come from one place; a nightly job moves orders between statuses, and the dashboard must show a new status within seconds. The status filter now scans all 12M rows and takes 9 s. Which change should the team make?⌄
MCQ-36An events table holds 60 million rows and takes 4,000 inserts/s. Its clustered primary key is a random UUIDv4, and the public API returns that same id in URLs. A load test at production row count measured p99 insert latency and index size: auto-increment BIGINT 3 ms / 1.0x, UUIDv4 22 ms / 1.4x, time-ordered UUIDv7 4 ms / 1.2x. Competitors scrape the API to count and order a tenant's events, so a public id must not reveal volume or insertion order. Which change meets both the latency and the exposure requirement?⌄
MCQ-38An events table holds 2 billion rows and was partitioned by month into 48 partitions. The nightly report, which filters `created_at` to the last 7 days, dropped from 4 s to 60 ms. The tenant dashboard, which runs `WHERE tenant_id = $1 ORDER BY created_at DESC LIMIT 50` with no time bound, went from 4 s to 7 s. Which change fixes the dashboard?⌄
MCQ-33A service on PostgreSQL 15 takes about 4,000 writes/s and 20,000 reads/s against a 40-million-row `orders` table. The `id` column is `integer` and will overflow within a month, so it has to become `bigint`. Three services read the table and two write it, the deploy pipeline runs migrations before the new code is live, and the write path has a 2-second p99 budget with no maintenance window available. Which approach should the team accept?⌄
MCQ-21Orders and Billing are separate services that both write to the `orders` table: Orders inserts a row on checkout, and Billing's nightly reconciliation upserts one row per payment. Orders added a `fulfillment_state` column in three steps: add nullable, backfill, set NOT NULL. Billing's upsert never supplies that column, so from the SET NOT NULL step every one of its 40,000 nightly rows failed with a not-null violation, and checkout p99 rose from 90 ms to 1.4 s while the failing job held its transaction open. The team wants the next schema change to be unable to break the other service. Which change achieves that?⌄
MCQ-34A `customers` table soft-deletes with `deleted_at timestamptz NULL` and carries `CONSTRAINT customers_email_key UNIQUE (email)`. A seven-year retention rule keeps the row in `customers`, and the audit report reads `deleted_at`. Last quarter 412 returning customers hit `duplicate key value violates unique constraint "customers_email_key"` on re-registration; support cleared `deleted_at` by hand on 380 of them, blanking the deletion timestamp the audit report needs. Which change fixes re-registration and keeps the deletion record?⌄
MCQ-86A team is reviewing a PR that will run the following against the production `orders` table (30 million rows, PostgreSQL 14) at 14:00, during peak traffic. Staging has 20,000 rows and the same statements completed there in 40 ms.
```sql
BEGIN;
ALTER TABLE orders ADD COLUMN currency text NOT NULL DEFAULT 'USD';
CREATE INDEX idx_orders_currency ON orders (currency);
COMMIT;
```
The reviewer has to predict the production effect before approving. What happens when this runs at 14:00?⌄
MCQ-50A Postgres 16 primary serves checkout. Baseline: checkout p99 180 ms, buffer cache hit ratio 99.5%, 42 of a 100-connection pool in use, 8 vCPU at 25%. At 14:00 a finance report runs one query that aggregates all 90 million rows of `orders` with no WHERE clause; it takes 40 s and reads 60 GB from disk. While it runs, checkout p99 rises to 2.4 s, the buffer cache hit ratio falls to 71%, and all 8 vCPUs sit at 100%. Checkout p99 returns to 180 ms within 5 s of the report finishing. Which mechanism explains the checkout p99 rise?⌄
MCQ-49An events table on PostgreSQL 15 holds 400M rows and takes 60% updates and deletes. Autovacuum runs every minute and logs no errors, yet over three days pg_stat_user_tables shows n_dead_tup climbing from 4M to 150M and the table growing from 180 GB to 260 GB. pg_stat_activity shows one backend with state = 'idle in transaction' and xact_start 9 hours ago. Insert p99 has gone from 3 ms to 11 ms. What should you do first?⌄
MCQ-32A service runs 24 instances, each with a HikariCP pool of maximumPoolSize=25, against a Postgres 16 primary with max_connections=500. At peak the logs fill with 'FATAL: sorry, too many clients already' and p99 latency rises from 40 ms to 900 ms. The primary has 8 GB RAM, each backend uses about 10 MB, and a reporting job plus admin sessions hold about 50 connections at peak. Which change addresses the cause?⌄
MCQ-40A pricing service reads through cache-aside: on a miss it SELECTs the row from Postgres and writes it to Redis with a 60 s TTL; a write does UPDATE Postgres, then DEL the key. Keys are `price:{tenant}:{sku}`. After a price change for tenant 3 / SKU 4412, reads kept returning the old price for the full 60 s TTL. Postgres held the new price the whole time, and the DEL did run. Which change removes the stale reads?⌄
MCQ-41A service caches a hot key in Redis with a 30-second TTL and no jitter. The key is read 6,000 times per second. On a miss, the service runs one database query (40 ms), serializes the result (20 ms), and writes it to Redis; the key is not readable again until the write completes. The database connection pool holds 50 connections. At the instant the key expires, how many recompute queries does the database receive before the key is repopulated?⌄
MCQ-25A URL shortener serves 150,000 redirects/sec at peak from an 8-node Redis cluster that shards keys by hash. A single celebrity short code takes 90,000 of those redirects/sec. During the campaign, p99 redirect latency rises from 30 ms to 450 ms; the node holding that code sits at 100% CPU while the other seven sit near 12%. The overall cache hit rate is 99.9%. Which change fixes the cause?⌄
MCQ-29An on-call service on PostgreSQL 16 (default isolation) keeps one row per surgeon with a status column and enforces 'at least one surgeon on call per shift' by counting the on-call rows for the shift, then setting the caller's own row to off_call in the same transaction. Each transaction writes only its own row. At 10x traffic the count reaches zero a few times a day and nothing is logged. Which change fixes the invariant?⌄
MCQ-31A payments service runs 120,000 transfers/min (2,000/sec) against an accounts table with a version column. 95% of transfers (1,900/sec) involve accounts with no concurrent writer; 5% (100/sec) touch one of two hot merchant accounts, each seeing 50 concurrent transfers/sec. A separate adjust endpoint updates one account 200/min, mostly hot accounts. Every transfer and adjust currently does SELECT ... FOR UPDATE on all rows in the order the request supplies them. p99 latency rose from 40 ms to 900 ms and deadlocks average 12/min; no lost updates have been observed. Which change best addresses the p99 and deadlocks while keeping no lost updates?⌄
MCQ-30A payments API and a nightly batch both update the accounts table. They deadlock about 240 times a day and 0.4% of payments fail. Both must keep running concurrently at current peak throughput, the schema is frozen, and the page that wakes on-call fires on the deadlock count rather than on failed payments. Which rule should the team adopt?⌄
MCQ-90An events service runs on 4 pods behind a load balancer and books seats in Postgres 16 with two statements: `SELECT seats_taken FROM events WHERE id = $1`, then, if the value is below `capacity`, `UPDATE events SET seats_taken = seats_taken + 1 WHERE id = $1`. The service's Postgres pool is capped at 20 connections. A load test fires 50 concurrent requests for the last seat of an event whose capacity is 1. Fourteen requests return 200 and the row ends at seats_taken = 14. Which change makes seats_taken never exceed capacity under the same load test?⌄
MCQ-52A social feed stores comments and replies on a primary with two read replicas; replica A lags the primary by about 40 ms and replica B by about 250 ms. Each session's reads are spread round-robin across both replicas, and the service takes 12,000 reads/s while the primary is sized for 2,000 reads/s. Users report three things: 8% of feed loads show a reply above the comment it answers, a comment they just posted is missing when the feed reloads, and a comment visible on one load is gone on the next. Which change fixes all three reports without exceeding the primary's read capacity?⌄
MCQ-39An app runs one primary in us-east-1 and one read replica in each of three regions. Profile reads go to the nearest replica; p99 replication lag is 900 ms. After a user saves their profile, the redirect reads from a replica, so 6% of users see their old details and re-save, creating duplicate change records. Reads outnumber writes 40 to 1, the primary already runs at 70% CPU, and writes must stay under 20 ms p99. Which routing policy should the team adopt?⌄
MCQ-70A ledger service keeps a single writer in us-east-1 and replicates asynchronously to a eu-west-1 replica; p99 replication lag is 300 ms. Frankfurt reads served from us-east-1 run at p99 190 ms, and the eu-west-1 replica answers the same reads in 30 ms. us-east-1 accounts generate 70% of write volume and see 25 ms writes; European accounts generate 2.4M writes a day. Product wants European writes accepted in eu-west-1 to bring their write latency to 25 ms. The team's conflict budget is 5% of writes to any account moved to a second write region. A week-long replay of production traffic shows 11% of the 2.4M daily European account writes land within 300 ms of another write to the same account in us-east-1. The ledger applies last-write-wins with no conflict detection, and a second write region costs +1.9x on the database tier. Which decision fits these numbers?⌄
MCQ-54A settlement job elects one writer through a lease in a consensus store: TTL 10 s, renewed every 3 s. Each acquisition returns a monotonically increasing epoch, and the settlement store rejects any write whose epoch is below the highest epoch it has already accepted. At 12:00:00 leader A holds epoch 41. At 12:00:02 A enters a 14 s stop-the-world GC pause while preparing its write, freezing its renewal thread. At 12:00:12 leader B acquires epoch 42 and writes the day's file. At 12:00:16 A resumes and sends its write, still carrying epoch 41. What does the settlement store do with A's write, and why?⌄
MCQ-55A multi-region key-value store lets any region accept a write for any entity and resolves conflicts with last-write-wins on each node's NTP-synced wall clock. Support reports edits reverting minutes after they are saved, and the incidents cluster on nodes whose NTP daemon restarted. Which ordering scheme is sound for this deployment?⌄
MCQ-51An events platform sells a run of 500 general-admission tickets. Inventory is a Postgres primary in eu-west-1 with one async streaming replica in eu-central-1 (replication lag p50 30 ms, p99 800 ms). Checkout runs in eu-west-1: it reads `qty_remaining` from the replica and, if it is at least 1, inserts an order row into the primary. During a 6-minute partition of the eu-west-1↔eu-central-1 link the replica kept serving its last-known count of 500 and 380 tickets were sold twice. The primary stayed reachable from checkout for the whole window. Checkout must keep accepting orders through a partition, and a double sale is not acceptable. Which change should the reviewer require?⌄
MCQ-53An order saga runs reserve stock → charge card → book courier. The courier is a third-party API the team cannot change: POST /bookings creates a booking and returns its id, and GET /bookings?ref={orderId} returns the booking for that reference or 404. Courier latency is p50 300 ms and p99 2.5 s, and about 8% of calls exceed the orchestrator's 1 s client timeout; the tail is long, with roughly 1 call in 200 running past 8 s. On timeout the orchestrator retries the step twice before compensating. Last month 5,000 orders left 400 with two courier bookings against the same reference. Which change stops the duplicate bookings?⌄
MCQ-56A checkout service runs five identical instances behind a round-robin load balancer. Sessions are stored in each instance's process memory. After scaling from one instance to five, 4 of every 5 authenticated requests return 401. The team must keep autoscaling and rolling deploys without pinning users to an instance. Which change removes the 401s?⌄
MCQ-57An 8-pod Kubernetes Deployment serves HTTP through an ingress that takes about 5 s to stop sending new requests to a pod after that pod is marked for termination. terminationGracePeriodSeconds is 30 and there is no preStop hook. On SIGTERM the process closes its listener and exits immediately. The longest request is a 45 s report export. In the last rollout every one of the 8 pods was killed mid-request, dropping about 6 in-flight requests each: 48 client errors. Which change removes those dropped requests?⌄
MCQ-58A 20-pod Deployment runs an API behind a Service. Liveness calls GET /healthz, which runs `SELECT 1` against the primary database with a 2 s timeout (periodSeconds: 10, failureThreshold: 3). Readiness calls GET /readyz, which returns 200 unconditionally. During a 90-second managed failover the primary refuses connections, every pod fails three consecutive liveness checks, and the Deployment spends 14 minutes in a restart loop while all 20 pods keep receiving traffic and returning 500s. Which change stops the restarts and takes pods whose database is unreachable out of the Service endpoints?⌄
MCQ-59A read endpoint has a p99 latency SLO of 200 ms. Load-tested against a restored copy of production data (40 million rows), one instance held the SLO up to 900 rps at p99 180 ms; the next ramp step, 1,100 rps, pushed p99 past 700 ms. The same endpoint against the 5,000-row staging dataset had reported 4,000 rps at p99 40 ms. Peak traffic is forecast at 6,000 rps, and the service must keep serving if one instance is lost. How many instances should the capacity plan provision?⌄
MCQ-60A checkout page issues 12 backend RPCs in parallel. Each dependency reports p50 = 20 ms and p99 = 400 ms, and users call a checkout slow when it exceeds 1 s. The page dashboard shows a mean of 55 ms, comfortably inside the 200 ms SLO. Which reading of the numbers is correct?⌄
MCQ-11A checkout service calls an inventory dependency. The client uses a 1 s per-attempt timeout, 2 retries with exponential backoff (200 ms base, full jitter), and a 2.8 s deadline: the gateway allows 3 s and the service keeps 200 ms of margin. The client starts a retry whenever the deadline has not yet passed. During an incident the dependency accepts connections but never sends a response. What does the checkout service do?⌄
MCQ-72A checkout service calls a payment provider with a 1 s timeout, 4 retries, and a fixed 250 ms backoff. Its circuit breaker opens after 50 failures in 10 s. During a provider latency spike to 4 s, checkout p99 rose from 240 ms to 7.2 s and the provider saw a 12x request spike from your service. The team wants to stop the next spike. Which change should they make first?⌄
MCQ-15A webhook sender delivers each event with up to 8 attempts: the first fires immediately, and after each failure it waits 1 minute before the second attempt, then doubles the wait before every later attempt (2, 4, 8, 16, 32, 64 minutes). After the eighth failed attempt the event moves to a dead-letter queue. A receiver's endpoint is unreachable from the moment an event is created until exactly 60 minutes later, when it returns healthy. The event is never replayed by hand. What happens to that event?⌄
MCQ-12Checkout runs on a shared 200-thread pool that serves every outbound call. The recommendations client sets no timeout, so when the recommendations service stalls, each call blocks its thread indefinitely. Within 40 s all 200 threads are parked in recommendations calls, checkout p99 rises from 120 ms to 9 s, and payments calls start failing with pool-exhaustion errors even though payments is healthy. The team adds a circuit breaker in front of recommendations that opens when the error rate exceeds 50% over a 10 s window with at least 20 requests. What happens next?⌄
MCQ-13An ingestion service buffers events from internal producers in an in-memory queue and consumers write them to a database. Traffic grew tenfold and is now sustained; during spikes the queue grows without bound and the process is OOM-killed, losing buffered events. Consumers are I/O-bound on the database and sit at 15% CPU. Producers already retry with exponential backoff when the service rejects them. Billing events must all be processed; analytics events may be dropped. Events must be processed within 5 minutes of arrival. Which change should the team make?⌄
MCQ-16A report endpoint aggregates tenant data inline and returns the result. Duration tracks data volume with no fixed upper bound: p50 is 3 s, p99 is 4 min, and the largest tenants have run past 20 min. The API sits behind a proxy that closes connections at 30 s, and the mobile client is frequently backgrounded mid-request. Which change addresses the cause?⌄
MCQ-17A media service accepts uploads up to 2 GB. The endpoint runs four gunicorn workers in a container with a 1 GB memory limit and reads each request body fully into memory before writing it to S3. At peak, 20 uploads arrive at once; the container is OOM-killed and in-flight uploads are lost. Each container has 10 GB of ephemeral disk, the same containers serve latency-sensitive API traffic, and the service already has an S3 bucket and can mint credentials. What should the team do?⌄
MCQ-10A gateway enforces a fixed-window limit of 100 requests per minute per API key, with windows aligned to wall-clock minutes and counters in a shared Redis store. A partner's client sends 100 requests at 12:00:59 and another 100 at 12:01:00. The database pool of 20 connections saturates and p99 latency rises from 40 ms to 180 ms. Which change addresses the cause?⌄
MCQ-24A service runs 12 instances behind a load balancer. A load test at four times current traffic plateaus at 2,400 requests per second. At the plateau, application CPU is 30% on every instance, the database sits at 40% CPU with its connection pool half used, and the single Redis instance holding per-tenant rate-limit counters is pinned at 100% of one core. The team needs ten times current traffic. Which change is most likely to raise the plateau?⌄
MCQ-20Payments and reporting run in one process on 4-core, 8 GB instances. Every night reporting holds a global lock for 45 minutes; during that window payments p99 goes from 80 ms to 3.2 s. Payments serves 1,200 rps, reporting 5 rps. Reporting needs 8 cores and 16 GB to finish in the window; payments needs 2 cores and 2 GB. A split adds a 2 ms p99 network hop to payment calls. The team wants to fix the nightly p99 spike and stop paying for 8-core, 16 GB instances for the combined service. What should they do?⌄
MCQ-6An internal API gateway replaced 6 REST calls (one per service) with a single GraphQL endpoint. Before the change, the mobile account screen issued the 6 calls in parallel: p50 180 ms, p99 240 ms. After the change, well-formed queries run at p50 45 ms, but p99 is 1.4 s. The gateway's Postgres pool is capped at 20 connections, and logs show a few clients issuing queries that scan the full 240,000-row product table. Which change restores the p99 while keeping the single endpoint?⌄
MCQ-22A team adds `Cache-Control: no-cache` and an `ETag` to a 20 KB JSON read endpoint that the origin serves 40,000 times an hour, with about 0.5 KB of headers on each response. A shared CDN sits in front of the origin and follows RFC 9111. What does the origin see in the first hour after deploy?⌄
MCQ-74A payments API runs on 4 instances behind a load balancer, and instances are replaced on every deploy. Each instance enforces a local token bucket of 100 requests per minute per API key, so a client with one key sent 400 requests per minute and all were admitted. The team must keep a key's admitted rate within 20% of 100 per minute, must not reject a client that stays under 100, and cannot add a network round trip to the request path: a Redis INCR per request pushed p99 from 12 ms to 45 ms. Which design meets all three?⌄
MCQ-19A platform team runs a shared API gateway in front of 40 services. The gateway terminates TLS, routes, and applies a coarse per-IP rate limit. Services are owned by different teams and deploy independently; a new service is reachable inside the cluster as soon as it is deployed, before anyone registers it with the gateway, and internal batch jobs call services directly rather than through the gateway. A proposal would move per-tenant quota enforcement and resource-level authorization into the gateway, since it already sees every external request. Which proposal should the reviewer approve?⌄
MCQ-75A payments service runs 12 instances. Its client resolves `payments.internal` through DNS, the records carry a 5-second TTL, and round-robins across the returned addresses. A rolling deploy replaces all 12 instances over 4 minutes. During each deploy about 25% of calls fail with `connection refused`, and the failures persist for the whole 4-minute window instead of clearing within seconds of each instance being replaced. Which change removes the failures?⌄
MCQ-98A chat service holds 500,000 WebSocket connections across 40 gateway nodes. Group conversations can have 500 members. On every message, the sending gateway reads a central Redis registry once per member to find the gateway holding that member's connection, then forwards directly; each lookup is a separate round trip. A load test sends 2,000 messages/sec to a 500-member group. Redis handles 1,000,000 registry reads/sec, its CPU pins at 100%, and p99 delivery latency climbs from 80 ms to 1.8 s. What change best fixes the latency at this message rate?⌄
MCQ-99A feed service precomputes timelines on write: every post is inserted into each follower's timeline. The fan-out fleet sustains 20,000 timeline inserts per second in aggregate. The median account has 300 followers; 12 accounts have 3-5M followers, and the largest has 4.2M and posts 8 times a day. After one of that account's posts, the fan-out queue backs up for 40 minutes and p99 post-to-visible latency for ordinary users rises from 300 ms to 25 minutes. Which change should the team make?⌄
MCQ-91An API gateway on 8 vCPU / 16 GB must hold 6,000 concurrent connections and serve 5,000 req/s. On that host the thread-per-request build reached 400 concurrent connections at 1.6 GB RSS and 4,000 req/s, while the async build with 4 event-loop threads held 8,000 connections at 300 MB RSS and 8,000 req/s, so the team shipped the async build. Its other three downstream calls already use a non-blocking client. A new endpoint then added a synchronous pricing client whose calls take 60 ms, almost all of it waiting on the pricing service. After that deploy, throughput is 60 req/s, RSS is still 300 MB, and host CPU sits at 6%. Which action should the team take?⌄
MCQ-88A checkout service's p99 is 420 ms and host CPU sits at 25% during the slow requests. A wall-clock profile of a representative production window attributes the average request as 310 ms blocked waiting to acquire a connection from the pool, 45 ms running queries once acquired, 35 ms JSON serialization, and 30 ms everything else. The pool is capped at 20 connections, the service runs 40 request threads, and the database allows 60 connections in total, of which a reporting job holds 15. Which change is most likely to cut p99?⌄
MCQ-69A payments service runs 8 pods behind a load balancer. Each pod fetches the database password once at start-up from a secret manager (token TTL 24 h) and holds it in memory for the life of the process. The password is rotated every 90 days. After the most recent rotation, 7 pods kept serving normally, but the one pod that had not restarted since before the rotation failed authentication on every query for 6 hours, until a deploy restarted it. What is the defensible fix?⌄
MCQ-81A service's lockfile pins `web-framework@3.2.0`, which depends on `template-engine@1.4.0` with an exact pin. A critical advisory lands: `template-engine` before 1.4.1 allows remote code execution when rendering a user-supplied template. The service renders user-supplied templates in its public preview endpoint. `web-framework@4.0.0` is the first release that allows `template-engine@1.4.1`, but it is a breaking major. The team's policy: critical and reachable → deploy within 24 hours; critical and unreachable → 7 days. What should the team do?⌄
MCQ-79An RDS Postgres table holds card tokens and account identifiers for a payments service. Storage encryption is on with a KMS key, the API→Postgres hop runs plaintext inside the VPC, and nightly snapshots are encrypted and copied to a second account. An attacker pulls a read-only database credential out of a leaked .env file in a CI job, connects to the database, and runs SELECT * on the transactions table, exfiltrating 2.3M rows in plaintext. Which change would have made that specific query return nothing readable?⌄
MCQ-76An endpoint builds its ORDER BY from a `sort` query parameter:
```python
# psycopg2, PostgreSQL 16
sort = request.args.get("sort", "created_at")
sort = sort.replace("'", "''")
sql = f"SELECT id, amount FROM payments WHERE status = %s ORDER BY {sort} LIMIT 100"
cur.execute(sql, (status,))
```
It normally answers in 20 ms. A pentester sends `?sort=(SELECT 1 FROM pg_sleep(5))`; the response body is unchanged, but the request now takes 5.1 s. Which change closes this without breaking the sort?⌄
MCQ-77GET /v1/invoices/{id} runs SELECT * FROM invoices WHERE id = $1 AND tenant_id = $2, binding $2 from the verified JWT claim, and returns 404 when no row matches. A pen-test token for tenant 41 walks ids 1–5000. For the first ~90 seconds after each deploy it gets 404 on every id it does not own; after that the same script gets 200 with another tenant's full invoice body on 3,412 of them. The leak shows up on all 12 pods, including pods that have only ever served tenant 41. p99 stays at 38 ms and the primary logs no errors. What explains it?⌄
MCQ-78A B2B SaaS stores every tenant's rows in one Postgres database with a shared schema; each table carries a tenant_id column, and the shared data-access layer appends `WHERE tenant_id = $1` to every query it builds. A contractor's new usage-export endpoint assembles raw SQL in a reporting module that never calls that layer. In a staging run with tenants 41 and 42 seeded, the export returned 1,180 rows for tenant 41, 96 of which belonged to tenant 42. The team wants the smallest change that makes this class of leak impossible rather than unlikely. What should they do?⌄
MCQ-8A red-team test on a payments platform: the edge gateway validates the caller's JWT, strips any client-supplied X-User-Id, and sets X-User-Id from the token's sub claim. The orders service reads X-User-Id and calls the ledger service with it; ledger returns invoices for that tenant. The red team ran a pod in the same namespace and sent GET /orders?tenant=8842 with X-User-Id: 8842 and no Authorization header; it received tenant 8842's invoices. The red team's own JWT was for tenant 117. Which change closes the finding?⌄
MCQ-9A backend engineer owns authentication for a service going live in three regions. Security requires that logging out or disabling an account takes effect within five minutes, and that no role or permission data reaches third-party logs. The team has ruled out replicating a session store across regions, and every request header is forwarded to a partner API that logs it. Which approach should the team accept?⌄
MCQ-80A payments service writes one audit record per privileged admin action into the same file as application debug logs. Each record is a plain text line carrying actor, target and outcome. Debug output averages 20 GB/day; the file rotates at 1 GB and keeps 4 files. An admin credential was used to change 40 payout accounts over a 3-hour window; the change was noticed 2 days later. When the team goes looking for the audit records of those 40 changes, what will they find?⌄
MCQ-100A payments service logs every request at info level. Twelve days ago an engineer added a debug line that writes the full request body; 4% of the 250,000 daily requests carry a card number in that body. The log pipeline ships each line to two stores in the aggregation cluster, a hot index and a cold archive, both retained for 30 days. How many card numbers are in the aggregation cluster today because of that debug line?⌄
MCQ-23An engineer is tracing a failed checkout that flows gateway → orders → payments. All three services log JSON with a `req` field taken from the X-Request-ID header, and reconstructing a failed checkout now takes about 40 s. The remaining gap: payments submits refunds to a worker pool created once at startup, and the worker's lines read `{"svc":"payments","msg":"refund ok"}` with no `req` field, so a refund cannot be tied to the checkout that triggered it. Refunds call an external provider and take 2-4 s, so they are offloaded to that pool, and the same order id can appear in retries and in several requests. Which change closes the gap?⌄
MCQ-73A payments service handles 300 million requests a month on a managed platform. Last month's bill was compute $6,000, egress $1,200, log ingestion $800, and object storage $400. The only change this month was a release that added a debug field copying the request body into every log line, taking the average line from 2 KB to 22 KB; the bill came to $11,400. Log ingestion is billed at $0.50 per GB. The incident the field was added for is now closed. What should the engineer do?⌄
MCQ-68A checkout service reads flags through an SDK that caches the last successful value for 24 hours and falls back to each flag's declared default when the flag service is unreachable. The flag service goes down for 40 minutes. `new_pricing` was set to 100% 14 months ago and its owner left; its declared default is `false`. `fraud_check_v2` is at 5% and its declared default is `false`. During the outage, 9% of requests hit the unmaintained old-pricing path and p99 latency rose from 40 ms to 180 ms. What is the most likely explanation and first fix?⌄
MCQ-67A payments service is moving from v1 to v2. The release renames the column `card_token` to `payment_token` and points v2's queries at the new name. The plan is blue-green: green runs v2, the load balancer switches 100% of traffic in one step, and the blue v1 fleet stays warm for 30 minutes for a switch back. In a staging dry run, v2 wrote 200 rows with `payment_token` set and `card_token` null, and a v1 read of those rows returned null tokens. What should the reviewer decide?⌄
MCQ-71A payments service runs Postgres with a 5-minute recovery point objective and a 1-hour recovery time objective. A nightly base backup runs at 02:00, and WAL segments are configured to ship to object storage every 5 minutes. At 14:07 the primary's disk fails and the node is lost. The last WAL segment in object storage is timestamped 13:52; the archive command had been failing silently for 15 minutes because its credentials expired. Rebuilding the node from the base backup and replaying WAL takes 38 minutes. The post-incident note states that the restore met both objectives. Which statement about that note is correct?⌄
MCQ-65At 14:02 a deploy of the checkout service goes out: a code change and a config change, no schema migration, and the previous build is one command away and reads the current schema unchanged. At 14:04 the 5xx rate on every route climbs from 0.2% to 18%, and the exception with its full stack trace is already in the logs. The dependency the service calls has a flat error rate and its other callers are healthy. The service is live and taking orders. Which approach should the team take?⌄
MCQ-62A pricing service reads one Postgres primary through a pool of 16 connections. Each request holds one connection while it runs its queries and waits when none is free. The dashboards carry request rate, error rate by class, and a p50/p95/p99 latency histogram per endpoint, scraped every 15 s, plus the database host's CPU and memory. Over a 22-minute incident the request rate held at 500/s, the error rate stayed at 0.08 percent, p99 latency went from 110 ms to 1.9 s, host CPU read 41 percent, memory 44 percent, and no request ever timed out waiting for a connection. After a release, mean query hold time is 30 ms, with 1 percent of queries holding a connection for 1.5 s. Which measurement change would have named the limiting resource while the incident was still running?⌄
MCQ-63A checkout request measures 900 ms at p99. One slow trace holds a 40 ms span in checkout-service and, under a different trace ID, a 300 ms span in payment-worker for the same order ID; the remaining 560 ms appears in neither trace. checkout-service publishes the order to a Kafka topic that payment-worker consumes. What is the correct next step?⌄
MCQ-64A payments API pages on four alerts. Last month's firings and how many led to action:
| Alert | Pages | Actioned |
| --- | --- | --- |
| CPU > 85% for 10 min | 180 | 3 |
| heap > 90% for 5 min | 96 | 2 |
| p99 > 800 ms for 5 min | 22 | 20 |
| checkout 5xx > 2% for 3 min | 9 | 9 |
The team adopts the rule: an alert keeps paging only if at least half of its firings led to action; the rest move to a ticket queue. Which outcome follows?⌄
MCQ-61A payments API carries an availability SLO of 99.9% over a rolling 30-day window, and the team freezes feature releases once more than half the error budget is spent. Fifteen days into the current window the service has been unavailable for a total of 30 minutes. How many minutes of error budget remain?⌄
MCQ-87Checkout p99 rose from 120 ms to 2.4 s at 14:05. Error rate is 0.3%, all timeouts on payments-db. Request rate is flat at 800 rps. The payments-db pool is pinned at 20/20 with a 4 s average wait for a connection. One sampled trace spends 9 s inside the payments-db call. payments-db CPU is 22% and disk latency is normal. The only deploy in the last hour was 12 minutes ago and changed frontend static assets; the latency rise began 40 minutes ago. What should the on-call engineer do first?⌄
MCQ-95An engineer is walking an interviewer through a checkout outage. The deploy shipped at 13:50. The first failed checkout was at 13:52, and 6% of checkouts failed while the error rate was elevated, which ended at 14:07. The error-budget alert fired at 14:02. The rollback completed at 14:06. Failed orders were replayed by hand until the incident closed at 14:31. Which summary holds up against that timeline?⌄
MCQ-96A staff candidate is asked about a technical disagreement. Their story: a teammate pushed for a message broker for a workflow handling 40 messages a day; the candidate prototyped a Postgres-backed queue in a day and showed it held p99 under 200 ms at 10x that volume; the tech lead chose the Postgres queue. The interviewer asks, "And then what?" Which reply keeps the story strong?⌄
MCQ-82A payments service runs 1,400 tests in CI: 1,290 unit tests that mock the repository and the message broker (0.15 s each), 96 integration tests (1.2 s each), and 14 end-to-end tests (30 s each). The suite takes 12 minutes against a 15-minute budget. Last quarter, 7 of the 9 production incidents came from persistence wiring: a missing NOT NULL, a unique constraint the ORM never enforced, a transaction that committed before the broker publish, and every one of those paths had unit tests that passed. 120 of the unit tests exercise repository writes or broker publishes. The end-to-end suite fails on about 1 run in 6 for reasons unrelated to the change under test. Which change is most likely to cut escaped defects?⌄
MCQ-83A payments service runs 1,180 integration tests in 4 s against an in-memory fake of its Postgres repository and an in-memory fake of its Kafka broker; the suite has been green for 7 months. Release 4.2 passed the suite, then in production two refunds for the same order were inserted 40 ms apart, the real table's unique index on order_id rejects the second, and a consumer on a 3-partition topic processed events out of order. Staging runs a single-partition topic and a seeded dataset with no concurrent writers. Which change to the test setup would have caught both failures?⌄
MCQ-84An integration suite of 300 tests runs against one shared Postgres database seeded from a hand-maintained dump. Each test file inserts its own rows and deletes them in an afterEach hook. Run one file alone: green. Run the whole suite in a single process: about 40 tests fail with duplicate key violations on users.email, and which 40 fail changes when you reorder files or add a new one. The dump is 11 migrations behind the app's schema. Which change removes the failures?⌄
MCQ-85A payments service ships from one immutable artifact. The pipeline on every merge to main is: unit tests 4 min, build the artifact 6 min, integration tests against that artifact 18 min, deploy to staging 2 min, smoke tests on staging 2 min, deploy the same artifact to production 3 min. Every production deploy, rollback included, is followed by a 2-minute smoke run against production. Rollback today means reverting the merge commit and pushing: the full pipeline re-runs and the revert PR takes a median 13 minutes to merge. The registry keeps the last 20 artifacts, the last three migrations only added nullable columns, and the previous artifact already passed staging when it first shipped. The team switches to rolling back by re-promoting the previous artifact. How long does that rollback take?⌄
MCQ-92Your team is estimating a new support endpoint that exports a tenant's invoices. The handler is 200 lines and calls an existing query. The invoices table has 40M rows across 12,000 tenants, and the query has no tenant filter. Support needs it in three weeks. The last three 'endpoint-only' estimates were 3, 4, and 2 days; actuals were 11, 9, and 7 days. Which estimate and plan should you give?⌄
MCQ-93A payments service pages on-call 40 times a month. Of the last 40 pages, 31 were cleared by one of three actions (roll back the deploy, scale the consumer group, or drain a node) and 9 needed a code change. Median time from page to first correct action was 27 minutes; the 6 pages that had a written runbook took 5. The wiki holds a 12-page architecture overview per service, last edited eight months ago, and no per-alert pages. Two incidents last quarter came from an engineer rolling back a healthy deploy when the alert's real cause was consumer lag. Which documentation change should the team make first?⌄
MCQ-94A checkout service's `/orders` endpoint returns `priceLabel` ("$12.34"), `statusLabel` ("Shipped"), and `customerName` (already concatenated). Product has asked for 9 such presentation-shaped fields over the past 6 months. The frontend team reports that 7 of its last 10 releases waited on a backend deploy to change a label, and each deploy adds 3 days. The backend has no locale data and no i18n library. A partner API launching next quarter must compute its own order totals from the same data. What should the team do?⌄
MCQ-89A service goes live next week. A four-day soak at production load shows the heap climbing from 1.2 GB to 6.0 GB and the longest pause from 40 ms to 900 ms, and the heap has not plateaued. The service holds a per-tenant cache, a metrics registry, and a listener list; the team has not measured which retains memory or what the allocation rate is, and the launch gate forbids restarts. Which approach should the team take?⌄
MCQ-66A payments team's postmortems carry no names and are published within 48 hours. Every action item has an owner and a due date; 39 of 47 closed on time last quarter. Yet 11 of the 16 incidents that quarter were recurrences of a failure mode an earlier postmortem had covered. In 13 of the 16 postmortems the contributing factor is written as 'operator ran the wrong command' or 'operator missed a step', and the action items are 'retrain the team' and 'add a reminder to the runbook'. Which change is most likely to cut the recurrence rate?⌄