You are asked to load test a new checkout API before a big sale. How do you plan and run it?
What the interviewer wants to hear
- Agree goals: expected traffic, latency and error targets
- Realistic scenarios and data based on production patterns
- Production-like environment and monitoring
- Ramp up, steady load, spike and soak as needed
- Analyse percentiles and bottlenecks, report and retest
Model answer
I start by agreeing targets with the team: expected peak requests per second for the sale with some headroom, p95 latency targets and an acceptable error rate. I study production traffic to build realistic scenarios, like browse, add to cart and pay in the right ratios, with varied test data. I write the scripts in k6 or JMeter with thresholds so the run passes or fails clearly. The environment should be production-like in size and config, and third-party payment calls are stubbed so we do not overload partners. I watch application metrics, database and infrastructure dashboards during the run. I ramp up gradually, hold steady load, then try a spike and possibly a soak test. Afterward I report p95 and p99 latency, throughput, errors and the first bottleneck found, then retest after fixes.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Automation Test Engineer questions
- How would you design a test automation framework from scratch for a web app?
- A test fails randomly in CI about 1 in 20 runs. Walk me through how you find and fix the cause.
- How do you manage test data in an automated suite that runs in parallel on shared environments?
- When should automated tests mock external services, and when should they use real ones?
- How do you make automated test results useful to developers and managers?
- How do you handle authentication in a large UI test suite without making every test log in through the UI?
- Your suite needs to run in parallel across many workers. What do you change to make that safe?
- Describe how you would set up automated tests in a CI/CD pipeline for a web application.
- How would you approach test automation for a mobile app on Android and iOS?