KatInterview

Build a Pluggable Connector Layer for Third-Party Services

System DesignModel answer
MediumModel answerSystem Designsystem-designintegrationswebhooks

Last updated

Design a platform that lets a product authorize customer accounts at many external vendors, run actions against them, and ingest their events reliably, with new connectors cheap to add.

Pluggable Connector Layer for Third-Party Services

Your product needs to work with many external vendors, for example email providers and team-chat tools. A customer links their own vendor account, the product triggers operations on that account (send a message, create a record), and the product also receives things that happen on the vendor side (new message, status change) through webhooks or by polling.

Engineering wants to add a new vendor without re-implementing authentication, retries, throttling, and monitoring each time.

Design the platform. Cover:

  1. The connector contract: what each vendor plugin must provide and what the platform owns.
  2. Account linking, secret storage, rotation, and revocation.
  3. How an action travels from the caller to the vendor and back.
  4. How inbound events are received, verified, deduplicated, and delivered.
  5. The data model.
  6. How one misbehaving vendor is kept from harming others.

Constraints and assumptions

  • Vendors differ in auth methods, quotas, pagination, webhook delivery guarantees, and error formats.
  • Customer credentials and event payloads are sensitive.
  • Both requests and events may arrive more than once and out of order.
  • A slow, failing, or throttled vendor must not stall unrelated connectors.
  • Explicitly state your assumptions about action latency and how much the payloads are normalized into a shared shape.

Questions worth asking the interviewer

  • Which actions and events must be identical across all vendors, and which can stay vendor-specific?
  • Does the caller wait for an action to finish, or can it complete asynchronously?
  • If a vendor has no webhooks, how fresh must the data be?
  • Do customers need control over data residency or retention?

Hints

Hint 1

Split the design into a stable platform lifecycle (link, execute, ingest, revoke) and a thin vendor-specific adapter. Do not force every vendor into one identical model; expose capabilities instead.

Hint 2

For actions, think about a durable job queue with idempotency keys, a classification of errors into retryable, non-retryable, and needs-reauthorization, and rate limiting keyed by vendor and by customer account.

Hint 3

For events, treat webhooks and polling as two sources feeding the same pipeline: verify, store the raw payload, deduplicate on a vendor event ID or content hash, then normalize and publish. Keep cursors for polling and support replay.