Mid-LevelAPI & Integration Testing
What is your approach to testing API response times and SLAs?
- response time
- SLAs
- performance
Answer it first, then compare. Nothing here is saved or scored.
Model answer
Include performance assertions in functional tests: (1) Assert response time is under the SLA (e.g., p95 < 200ms). (2) Measure and trend response times in CI over time. (3) Set up alerts when response times degrade beyond thresholds. (4) Test under realistic conditions (auth, typical payload sizes). (5) Separate performance benchmarks from functional tests to avoid flakiness. Tools: Playwright request timing, k6 for dedicated load tests, custom timing middleware.
What interviewers listen for
- Schema-first thinkingYou validate response shape before you assert on values, every time.
- Status-code literacyYou can defend why 401 vs 403 vs 422 matters for the consumer.
- Contract awarenessYou know when consumer-driven contract tests beat end-to-end checks.
- Auth fluencyYou can describe rotating tokens across parallel workers without secrets in logs.