Outbound clients need explicit deadlines, connection limits and error policy. A timeout response does not prove a remote mutation failed.
Before you start
You should know Java classes, dependency injection and basic HTTP requests. Identify where a call crosses a framework-managed boundary. The snippets illustrate a focused mechanism; database configuration, application wiring and authentication must be supplied by the surrounding application when applicable.
The practical goal is to reason through this situation: A service propagates a request deadline and bounds its payment-status lookup. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Assign deadline ownership
An outbound call must fit the incoming operation’s remaining budget.
Step 2: Bound attempts and resources
Set timeout, connection and retry limits with backoff and jitter where useful.
Step 3: Separate uncertain mutations
A timeout may occur after the remote server completed a write.
Worked scenario
A service propagates a request deadline and bounds its payment-status lookup.
A status lookup can often be retried within a remaining deadline. A payment creation timeout needs an idempotency key or reconciliation because a second attempt may duplicate the charge. Even safe retries can amplify an outage if every instance retries simultaneously without bounds.
Common mistake
Blind retries can duplicate remote effects.
Verify the behavior
Test delayed response, timeout, exhausted deadline and duplicate mutation prevention.
Interview exercise
Retry a read operation safely.
Answer and reasoning
Use bounded attempts, backoff and remaining-deadline checks; separately establish idempotency for any mutation.
Continue learning
Compare the scenario with the Spring Boot interview questions and test your understanding with the Spring Boot MCQs. For terminology and implementation details, consult the reference material.