Diagnose Forbidden Responses in an HTTP Request Replayer
Quick Overview
Diagnose HTTP 403 failures in a request replayer by comparing actual method, URL, headers, body, and authentication semantics with safe regression fixtures.
Diagnose Forbidden Responses in an HTTP Request Replayer
Company: Stripe
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
You are integrating a request replayer using a JSON library and an HTTP client. Replayed requests consistently receive HTTP 403 responses, and authentication handling is suspected. How would you isolate the mismatch between the recorded request and the request actually sent?
### Constraints & Assumptions
The source mentions Gson and OkHttp but does not supply the request schema or authentication protocol. Use the provided API documentation and test environment; do not guess credentials or bypass access controls.
### Clarifying Questions to Ask
- Which method, URL, headers, body, and authentication fields are part of the replay contract?
- Are tokens, signatures, cookies, or timestamps valid for replay, or must they be regenerated?
- Does the response body distinguish authentication failure from an authorization or policy denial?
```hint Compare the wire request
Correctly parsed JSON does not guarantee that the client sent the intended header names, body bytes, or target URL.
```
### What a Strong Answer Covers
- A minimal failing case and comparison of documented versus actual request fields.
- Authentication lifetime/signature issues and authorization distinctions.
- Safe logging, local request capture, and regression tests.
### Follow-up Questions
- Why might reserializing JSON invalidate a signed request?
- What should a replayer do with non-idempotent requests?
Overview: Diagnose HTTP 403 failures in a request replayer by comparing actual method, URL, headers, body, and authentication semantics with safe regression fixtures.
You are integrating a request replayer using a JSON library and an HTTP client. Replayed requests consistently receive HTTP 403 responses, and authentication handling is suspected. How would you isolate the mismatch between the recorded request and the request actually sent?
Constraints & Assumptions
The source mentions Gson and OkHttp but does not supply the request schema or authentication protocol. Use the provided API documentation and test environment; do not guess credentials or bypass access controls.
Clarifying Questions to Ask Guidance
Which method, URL, headers, body, and authentication fields are part of the replay contract?
Are tokens, signatures, cookies, or timestamps valid for replay, or must they be regenerated?
Does the response body distinguish authentication failure from an authorization or policy denial?
What a Strong Answer Covers Guidance
A minimal failing case and comparison of documented versus actual request fields.
Authentication lifetime/signature issues and authorization distinctions.
Safe logging, local request capture, and regression tests.
Follow-up Questions Guidance
Why might reserializing JSON invalidate a signed request?
What should a replayer do with non-idempotent requests?