Untitled

Interviewer’s problem statement

In this interview, we will design a Webhooks system. Webhook is a mechanism for one software system to notify another system of events. They are widely used in distributed systems for event-driven architectures like payment processing. For example, in online shopping, after user initiates the payment flow, she is directed to 3rd party payment processing vendors like Shopify, Paypal, or a bank; then the payment vendor send the payment to the online store’s backend server. This backend server is called Webhook server, it receives events update and process accordingly.

Applicant Step 1: Write down the operation flows

This is the first challenge for the applicants: Disambiguate the vague problem statement. One strong strategy is to convert the vaguely described product into a clearly defined operation flow. This will both clarify any functional requirements and set up the framework for the formal technical discussion. Here, let’s assume the agreed upon flows are the following.

Event configuration

Operating engineers can add, edit, or delete event configurations in the Webhook system. Each event is defined as a pair of <event_id, operation_id>

Event triggering

https://documents.lucid.app/documents/8827d7c0-63bb-4b20-894c-d2c4f8efe6c3/pages/0_0?a=581&x=42&y=419&w=1026&h=443&store=1&accept=image%2F*&auth=LCA e2d44d48b376bd78ff7bf293f4a714b60e5f6b2771a5bb7ebccce081abfa05aa-ts%3D1718733231

  1. External events are sent to our API endpoint
  2. After receiving the event, we match its event_id in our configuration and find the corresponding operation_id
  3. The Webhook system execute the specified operation.
  4. The processing result persists to DB.

In this solution, we will only design the event triggering flow. The configuration flow is easy to scale. Interested user can refer to our Designing an URL shortener solution.

Applicant Step 2: Identify the hard questions

Here comes the second challenge which is a strong indicator of the interview result: To identify the hard questions which is the real meat of the interview. This naturally follows the user flow specification step and further defines the focus for the rest of the interaction between the applicant and her interviewer.

Below are the hard questions I would bring out in an interview.

Applicant Step 3: Building the solution