You are asked to performance test a new API before a big launch. How do you plan and run it?
What the interviewer wants to hear
- Agree goals: expected and peak traffic, percentile response-time targets, error budget
- Build a realistic workload model from analytics: endpoint mix, data, think time
- Use a production-like environment and test data, and monitor the servers
- Run several test types: baseline, load, stress, spike and soak
- Analyse p95/p99, throughput, errors and resource use; find bottlenecks and retest
Model answer
I start by agreeing measurable goals with product and engineering, for example 1,500 requests per second at peak with p95 under 400 ms and errors under 0.5%. Then I build a workload model from analytics or business forecasts: which endpoints are called, in what mix, with what data and pauses. I script it in k6 or JMeter and run it against a production-like environment with realistic data volumes, while watching CPU, memory, database and queue metrics. I run a baseline first, then a load test at expected peak, a stress test to find the breaking point, a spike test for launch bursts and a soak test for leaks. I report percentiles rather than averages, and where it fails I work with developers to find the bottleneck and rerun. Thresholds in CI catch regressions later.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium QA Engineer questions
- You are given a new "split payment" feature in a payments app. How would you create a test plan?
- How do you test a REST API? What do you check beyond the status code?
- A developer says your bug is "working as designed", but you think users will be confused. What do you do?
- Your team wants to start test automation. Which tests would you automate first and which would you keep manual?
- How do you manage test data for testing across multiple environments?
- Your automated UI suite has become flaky and the team has started ignoring failures. How do you fix the situation?
- How would you test a card payment checkout for an e-commerce site in the UAE?
- An app is launching an Arabic version for the UAE and Saudi Arabia. What do you test?
- How do you include accessibility testing in your normal QA work for a web application?