Interview Question

You need to call an external API after an opportunity closes. How would you design it?

Direct Answer

I would avoid doing a fragile synchronous callout directly inside the transaction and instead design an async pattern that can log outcomes, retry safely, and respect limits.

Detailed Explanation

A strong answer might propose a queueable job triggered from a service layer, backed by named credentials, clear payload mapping, error logging, and idempotent retry logic. The key is that the candidate thinks about reliability and operations, not just how to send an HTTP request.

Why the Interviewer Asks This

The interviewer wants to see architecture judgement and operational maturity.

Weak Answer Warning

A weak answer jumps straight to an HTTP callout from the trigger without discussing async design or error handling.

Stronger Answer Direction

Explain separation of concerns, async orchestration, credentials, and observability.

Follow-up Question

How would you prevent duplicate API calls if the job retries?