What is your approach to testing webhooks?
- webhooks
- async testing
- event-driven
Answer it first, then compare. Nothing here is saved or scored.
Model answer
Challenges: webhooks are asynchronous and push-based. Approach: (1) Set up a webhook receiver (ngrok, webhook.site, or custom endpoint). (2) Trigger the event and verify the webhook is received within the timeout. (3) Verify payload structure, signature, and headers. (4) Test retry logic: return 500 and verify retries with backoff. (5) Test idempotency: process the same webhook twice, verify no duplicate effects. (6) Test signature verification: tamper with the payload and verify rejection. (7) Test ordering: verify events arrive in order or handle out-of-order gracefully.
What interviewers listen for
- Schema-first thinkingYou validate response shape before you assert on values, every time.
- Status-code literacyYou can defend why 401 vs 403 vs 422 matters for the consumer.
- Contract awarenessYou know when consumer-driven contract tests beat end-to-end checks.
- Auth fluencyYou can describe rotating tokens across parallel workers without secrets in logs.