Skip to content
Tech Interview Prep
Technical interview guide

Webhooks & Asynchronous API Integration

Handling work that can't complete within a single request/response cycle: inbound webhooks and long-running async job APIs.

Read
23 min
Practice MCQs
25
Interview Q&A
25
Edition
v3
Editorial status
Reviewed

Scope: HTTP Semantics RFC 9110 and OpenAPI Specification 3.2.

Curated: · Written: · Reviewed:

25 questions

MCQ-1What delivery guarantee can a webhook sender realistically offer?
MCQ-12Which transport suits one-way server-to-client notifications over HTTP?
MCQ-14Why should a webhook provider also offer a polling API?
MCQ-24What is the effect of processing a webhook inline before responding?
MCQ-11What is the risk of returning 200 while failing to process an event?
MCQ-22Which failure should a webhook sender NOT retry?
MCQ-2A provider signs each webhook with HMAC-SHA256 over the exact bytes it transmits and sends the hex digest in `X-Signature`. Your handler parses the JSON, re-serialises it with the framework's encoder, and compares digests. Staging passes; production fails on about 2% of events. Why must the signature be computed over the raw request body instead?
MCQ-23A payments provider POSTs webhooks to your Express service. The route verifies `X-Signature: sha256=<hex>` as HMAC-SHA256 over the raw request body using `WEBHOOK_SECRET`. Since the route was changed to read `req.body`, the object `express.json()` produces, every delivery fails verification: 100% of roughly 4,000 a day. You capture one failing request's raw bytes and run `openssl dgst -sha256 -hmac "$WEBHOOK_SECRET"` over them; the digest it prints equals the hex in the `X-Signature` header the provider sent. The header your service logs also matches that value byte for byte. What is the cause?
MCQ-3What does including a timestamp in a signed webhook payload prevent?
MCQ-10A webhook receiver verifies HMAC-SHA256 tags with a loop that returns false at the first byte that differs. An attacker sends 10,000 requests per second and, by averaging many samples, resolves response-time differences of a few microseconds. They forge a tag the receiver accepts for a message that was never signed. What made that possible?
MCQ-25A webhook provider delivers with at-least-once semantics. It waits 10 s for a 2xx response; if none arrives it marks the attempt failed and retries 20 s after each failed attempt, up to 3 retries. A consumer's handler takes 15 s: it writes an order row and then returns 200. One event is first attempted at 12:00:00. How many order rows does the handler write for that event?
MCQ-15A payments provider POSTs `payment.succeeded` webhooks to a merchant's endpoint. Every delivery of one event carries the same `X-Event-Id: evt_7c1` and an incrementing `X-Attempt` (1, 2, 3, 4). The JSON body includes `"delivered_at"`, which the provider sets to the current time on each attempt. The handler computes `sha256(raw_body)`, inserts it into `processed_events`, and skips the charge when the insert conflicts. During a 24-hour provider outage one event was retried 4 times and the customer was charged 4 times. The merchant also takes genuine repeat orders, where the same customer is charged the same amount twice in one day. Which change makes the handler charge once per event?
MCQ-18A webhook consumer handles `order.paid` events. Its handler inserts the event's `X-Event-Id` into `processed_events`; on a unique violation it returns 200 and stops, otherwise it updates the order row to `paid` and returns 200. Deploys SIGKILL the pod with no drain, and the sender retries any delivery that gets no 2xx. Last month 900 orders were left unpaid even though their events were marked processed. Which change makes each event's effect happen exactly once?
MCQ-16Why can a webhook sender not guarantee event ordering?
MCQ-17Your order service pushes `order.updated` webhooks to a fulfillment partner. Each payload carries the order's full state at the time of the change, and the partner's handler applies every payload it receives as the current state: it checks no version or timestamp. Delivery retries 12 times over 6 hours with exponential backoff, then dead-letters the event and pages on-call. The partner has no pull API. Last Tuesday the partner's endpoint returned 503 for 9 hours and 4,100 events were dead-lettered; since it recovered, events have been delivered and applied normally. What should the team do with the 4,100 dead-lettered events?
MCQ-4A payments provider POSTs webhooks with an HMAC-SHA256 signature header and treats any non-2xx response, or no response within 5 s, as a failure to retry with backoff. The receiver verifies the signature, appends the event to an in-process buffer, returns 200, and a goroutine flushes the buffer to Kafka every 500 ms. Deploys send SIGTERM and SIGKILL the pod 2 s later; the flush goroutine does not drain on SIGTERM. Peak arrival is 40 events/s and deploys run at peak. Over one week the sender logs 2,100,000 deliveries, every one answered 200, while Kafka holds 2,098,600 events, and the Kafka client logs no produce errors. What accounts for the 1,400 missing events?
MCQ-9A payments provider you do not control posts webhooks to your endpoint at about 12,000 deliveries/hour. Its documentation says only the HTTP status code is inspected, the response body is discarded, and any non-2xx response is retried with exponential backoff for 24 hours. The provider ships new event types most months; `payout.paid`, added last week, is now 6% of deliveries and your handler has no mapping for it. Your data-retention policy forbids persisting payloads you cannot process. What should the endpoint do with an unrecognised type?
MCQ-5A webhook delivery worker applies this policy to every delivery: 2xx is success; 429 and 5xx are retried with exponential backoff up to 3 attempts; any other 4xx is terminal and is not retried; after 2 consecutive terminal responses on a subscription, the worker disables that subscription and stops delivering its events. A subscription's endpoint is configured to return 410 for every request, and the worker has four events queued for that subscription. How many delivery attempts does the worker make for those four events, and what is the subscription's state afterward?
MCQ-8A webhook sender drains one shared FIFO queue with 200 workers. A failed delivery is re-enqueued at the head of the queue after a 1 s delay, so a retry is picked up before any first attempt behind it. One receiver's endpoint answers every request with 503 in about 5 ms and stays down for six hours. Its retry backlog reaches 96,000 events, and over those six hours p99 delivery latency for every other receiver rises from 40 ms to 2.4 s. Why does the sender need a circuit breaker scoped to that one endpoint?
MCQ-21Checkout POSTs an order event to fulfilment over HTTP, retrying 3 times over 30 seconds before dropping it. A 12-minute deploy last month took every fulfilment instance down at once: 4,100 orders were never fulfilled, and checkout slowed badly because its 200 request threads sat blocked in retries. Checkout holds retry state in memory and redeploys several times a day. Orders must be fulfilled within 15 minutes of checkout. Both services are owned by the same team. Which change keeps every order and still fulfils within 15 minutes?
MCQ-13A team adds a WebSocket channel to a stateless HTTP service that runs 30 pods behind a round-robin load balancer and redeploys several times a day. After launch, every deploy produces a burst of client errors and reconnects, and the load balancer reports connection counts skewed across pods. Which operational cost does this expose?
MCQ-6A webhook sender checks a tenant's callback URL twice. At save time it resolves the hostname and rejects the URL if the address is in 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8 or 169.254.0.0/16. At delivery time it resolves the hostname again and rejects it only if the address is in 169.254.0.0/16. Which registered URL passes both checks and still lets the worker reach an internal service?
MCQ-7A webhook sender looks up the registered endpoint hostname at registration, rejects private ranges, and stores the URL string. A delivery to a customer-controlled endpoint that passed that check still reached 169.254.169.254, and the endpoint's hostname still points at a public address. Where must the private-address check be repeated?
MCQ-19Why should a webhook sender never return the receiver's response body to the consumer?
MCQ-20A platform team publishes an OpenAPI 3.1 document for their orders API. When an order is created, their service POSTs an `order.created` event to a URL each tenant registered earlier through `PUT /tenants/{id}/callback-url`. Tenants hand-write parsers and break whenever a field is added. The team wants tenants to generate typed handlers and validate the payloads they receive, using the published document alone. Which change achieves that?