Skip to content

Performance Test Engineer Interview Questions & Answers

40 questions for Performance Test Engineer interviews — 4 easy, 29 medium, 7 hard.

About the Performance Test Engineer role

Plans, scripts and runs load, stress and soak tests for web applications and APIs, mainly with Apache JMeter, then analyses results with server monitoring to find bottlenecks. Builds realistic workload models with correlation, test data and think time, and runs tests in CI pipelines. Interviews test JMeter elements, correlation, percentiles and throughput, distributed and non-GUI runs, and how you explain results and risks to developers and managers.

Apache JMeter Workload modelling Correlation and parameterization Results analysis Monitoring and APM
Solved for this roleStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

How do you mock an external API in automation tests?

Save to ▾
Show answer
Use a tool such as WireMock or MockServer to run a stub server that returns predefined responses for given requests. Point the application or tests to the stub with configuration. This lets you test error codes, timeouts and edge cases that are hard to trigger on the real service, and keeps tests stable when the third party is down. Still keep a few tests against the real integration.
02

What is the Maven Surefire plugin and how do you configure it for TestNG?

Save to ▾
Show answer
Surefire runs tests during the test phase. For TestNG, configure suiteXmlFiles with the path to testng.xml, so mvn test runs that suite. You can pass system properties, set parallel and threadCount, and control reports. Make the suite file a property like ${suiteXml} so CI can choose smoke.xml or regression.xml with -DsuiteXml=smoke.xml.
03

What is idempotency in REST APIs and why does it matter for testing?

Save to ▾
Show answer
An idempotent operation gives the same result no matter how many times it is called. GET, PUT and DELETE should be idempotent; POST usually is not. Testers verify that repeating a PUT does not create duplicates and that a second DELETE returns a sensible status like 404 or 204. Retries in networks and CI make idempotency important to verify.
04

Write a JSR223 Groovy PostProcessor that reads a JSON response and stores a value as a JMeter variable.

Save to ▾
Show answer
// JSR223 PostProcessor, language: groovy import groovy.json.JsonSlurper def body = prev.getResponseDataAsString() def json = new JsonSlurper().parseText(body) if (json?.orderId) { vars.put('orderId', json.orderId.toString()) } else { prev.setSuccessful(false) prev.setResponseMessage('orderId missing in response') }
05

Your company is debating a cloud device farm versus an in-house device lab. How do you advise?

Save to ▾
Show answer
A cloud farm gives hundreds of device and OS combinations, parallel capacity and no hardware maintenance, but costs per minute, adds network latency and may raise data privacy concerns. An in-house lab is cheaper over time for a small fixed set of devices and gives full control, but needs USB hubs, OS updates, battery care and someone to maintain it. Many teams keep a few local devices for debugging and use the cloud for wide coverage.
06

Your Jenkins test stage marks the build green even though tests failed. Why?

Save to ▾
Show answer
Possibly testFailureIgnore is set to true in Surefire, the shell step uses || true, or the script swallows Maven's exit code. Sometimes tests catch exceptions and never fail. Check the console log for Maven's BUILD result and Surefire summary. Fix the configuration so failures produce a non-zero exit, or use junit publishing to mark the build unstable when tests fail.
07

How do you extract an auth token with JSON Extractor and use it in later JMeter requests?

Save to ▾
Show answer
Add a JSON Extractor as a child of the login sampler. Set the variable name to token, the JSON path expression to $.access_token, match number 1 and a default like TOKEN_NOT_FOUND so failures are visible. Then add an HTTP Header Manager at Thread Group level with Authorization set to Bearer ${token}. Each thread extracts and uses its own token, because JMeter variables are per thread.
08

How do you pass parameters like browser and environment from Maven to your tests?

Save to ▾
Show answer
Pass system properties on the command line, for example mvn test -Dbrowser=firefox -Denv=qa. Read them in Java with System.getProperty("browser", "chrome"), giving a default. Surefire forwards -D properties to the forked test JVM, or you can declare them under systemPropertyVariables. Jenkins can expose these as build parameters so testers choose browser and environment per run.
09

What is the difference between open and closed workload models in load testing?

Save to ▾
Show answer
In a closed model a fixed number of users loop through the scenario, so when the server slows down, users wait and the arrival rate drops, which can hide problems. In an open model new requests arrive at a set rate regardless of response time, like real internet traffic, so a slow server builds a queue. JMeter thread groups are closed by default; the Open Model Thread Group or throughput timers approximate open workloads.
10

What is the difference between git merge and git rebase?

Save to ▾
Show answer
Merge combines branches by creating a merge commit, keeping the full history exactly as it happened. Rebase replays your commits on top of another branch, producing a straight, linear history without a merge commit. Rebase is good for tidying a local feature branch before a pull request; never rebase commits that others have already pulled, because it rewrites history.
11

What is the use of Maven in automation projects?

Save to ▾
Show answer
It manages dependencies through pom.xml, builds the project, runs tests with Surefire and standardises structure across teams.
12

What is the difference between average, median and 95th percentile response time?

Save to ▾
Show answer
Average is the sum divided by count, so a few very slow requests can distort it. Median is the middle value, meaning half the requests were faster. The 95th percentile means 95 percent of requests were faster than that value, which reflects what most users experience including slow cases. SLAs are usually written on 90th, 95th or 99th percentiles because averages hide long tails that frustrate real users.
13

How do you run tests on multiple browsers in parallel in Jenkins?

Save to ▾
Show answer
Use a parallel block in the pipeline with a stage per browser, or a matrix directive with axis BROWSER values chrome, firefox and edge. Each branch runs mvn test -Dbrowser=${BROWSER}, ideally against Selenium Grid or containers so agents do not need local browsers. Publish results per branch with clear names so failures show which browser broke.
14

What are Maven dependency scopes?

Save to ▾
Show answer
compile is the default and available everywhere. test is only for test compile and run, such as TestNG and REST Assured. provided is needed for compiling but supplied at runtime by the container. runtime is not needed to compile but needed to run, like JDBC drivers. system and import are rarer. In test projects, mark test libraries as test scope unless framework code in src/main uses them.
15

How do you handle stakeholders who ask for performance testing only a few days before go-live?

Save to ▾
Show answer
Situation: a product team requested load testing three days before launch. Task: give useful results fast and set expectations. Action: I explained the risk, agreed on the two most critical journeys, reused API scripts and ran a short load and spike test, sharing results daily. I also proposed adding a performance stage to future sprints. Result: we found a missing database index before launch, and the next release included performance tests from the start.
16

What is a webhook and how do you test it?

Save to ▾
Show answer
A callback where one system sends an HTTP request to another when an event occurs. Test with a mock receiver or tools such as webhook.site and verify the payload.
17

A test reading a properties file works in the IDE but fails in Jenkins with FileNotFoundException. Why?

Save to ▾
Show answer
The file path is probably hard-coded or relative to the IDE working directory, or uses Windows backslashes while Jenkins runs on Linux. Load the file from the classpath with getClass().getClassLoader().getResourceAsStream("config.properties") and keep it in src/test/resources, or build paths with Paths.get. Also check the file is committed to Git and not ignored.
18

What is the Maven Failsafe plugin and how is it different from Surefire?

Save to ▾
Show answer
Surefire runs unit tests in the test phase and stops the build as soon as tests fail. Failsafe runs integration tests in the integration-test phase and checks results later in the verify phase, so post-integration-test steps, like stopping a server or Docker containers, still run after failures. By default Failsafe picks classes named *IT. Many teams run UI and API suites through Failsafe with mvn verify for that reason.
19

How are throughput, response time and concurrent users related?

Save to ▾
Show answer
Little's Law links them: concurrent users equal throughput multiplied by the time each user spends per request, which is response time plus think time. For example, 50 requests per second with 2 seconds response and 8 seconds think time needs about 500 users. If response time rises while users stay fixed, throughput falls. This helps you size thread counts from a target throughput and spot when the system has saturated.
20

Tests pass on QA but fail in the staging pipeline. How do you investigate?

Save to ▾
Show answer
Compare what differs: configuration URLs, test data, feature flags, user permissions, network or proxy, browser versions and timing due to slower servers. Check logs and screenshots from staging and rerun one failing test with verbose logging. Often the issue is missing data or a flag. Fix by making environment settings explicit and creating required data in test setup.
21

What is an API and what are common HTTP methods?

Save to ▾
Show answer
An interface for systems to talk to each other. GET reads, POST creates, PUT replaces, PATCH updates partially and DELETE removes.
22

Why is JSR223 with Groovy preferred over BeanShell in JMeter?

Save to ▾
Show answer
JSR223 elements with Groovy compile scripts once and cache them, so they run much faster and use less CPU under load. BeanShell is interpreted on every call and becomes a bottleneck at high thread counts. Groovy also supports modern Java syntax and is the default JSR223 language. Enable caching by keeping the cache compiled script option on and passing values through vars or parameters, not by embedding ${} inside the script.
23

What is contract testing?

Save to ▾
Show answer
Verifying that a provider and consumer agree on request and response formats, using tools like Pact, to catch breaking changes early.
24

What is Docker and how does it help tests?

Save to ▾
Show answer
Docker packages tools in containers so tests run identically everywhere; Selenium Grid and browsers can be started quickly in containers.
25

Describe a time you automated a manual build or release step for the QA team.

Save to ▾
Show answer
Situation: before each regression a tester spent an hour deploying the build to QA and seeding data by hand. Task: remove that manual step. Action: I wrote a Jenkins pipeline stage that deployed the build, ran database seed scripts and a smoke check, then triggered the regression job, and documented it for the team. Result: setup dropped to ten minutes without human effort, and regressions could run overnight automatically.
26

Your UI tests run noticeably slower on the Grid than on your laptop. How do you find the cause?

Save to ▾
Show answer
Every command now travels over the network, so chatty code with many findElement calls or getText in loops suffers most. Check latency between test runner and Grid, ideally keeping them in the same network or region. Check node resources: overloaded CPU or many sessions per container slow browsers. Video recording and VNC add overhead. Reduce round trips by batching checks, using JavaScript for bulk reads and avoiding implicit waits combined with explicit ones.
27

How do you undo a commit that has already been pushed?

Save to ▾
Show answer
Use git revert <commit>, which creates a new commit that reverses the changes and keeps history intact, safe for shared branches. git reset moves the branch pointer backwards and is fine for local commits, but resetting and force-pushing a shared branch rewrites history and breaks teammates' clones. If force push is truly needed, use --force-with-lease and tell the team.
28

How do you record a JMeter script with the HTTP(S) Test Script Recorder?

Save to ▾
Show answer
Add the recorder from Templates using the Recording template, which also creates a Thread Group and Recording Controller. Start the recorder on port 8888, set your browser or system proxy to localhost:8888 and import the ApacheJMeterTemporaryRootCA certificate so HTTPS works. Perform the user journey, then stop. Afterwards remove static resources and third-party calls, add correlation for dynamic values, parameterize data and add think time.
29

How do you run Selenium tests in Docker containers in CI?

Save to ▾
Show answer
Use official Selenium images, either standalone-chrome for simple runs or a Grid with hub and node containers via Docker Compose. The test container or Jenkins agent points RemoteWebDriver to http://selenium-hub:4444. Containers give the same browser version everywhere and are cleaned after each run. Add shm_size for Chrome stability and record videos for failed tests if needed.
30

How do you store passwords and tokens safely in Jenkins?

Save to ▾
Show answer
Use the Jenkins Credentials store and bind them in the pipeline with withCredentials or the credentials() helper in environment blocks. Jenkins masks the values in console logs. Never hard-code secrets in the Jenkinsfile, pom.xml or properties files committed to Git. For larger setups, integrate a vault service and give each job only the credentials it needs.
31

What is REST Assured?

Save to ▾
Show answer
A Java library that makes API tests readable using given-when-then, with easy request building, response validation and JSON path support.
32

How do you test an API that supports multiple versions at the same time?

Save to ▾
Show answer
First learn how versions are selected: URL path like /v1 and /v2, a header, or a query parameter. Keep a request specification per version and run the shared contract tests against each supported version, plus version-specific tests for new fields or changed behaviour. Check that old versions still return their original response shape so existing clients do not break, and that deprecated versions send the agreed deprecation headers or errors.
33

What is the difference between SOAP and REST?

Save to ▾
Show answer
SOAP is a strict XML protocol with WSDL and WS-Security; REST is a lighter architectural style using HTTP and usually JSON.
34

Chrome inside a Docker node keeps crashing with session deleted because of page crash. How do you fix it?

Save to ▾
Show answer
This is almost always shared memory exhaustion, because Docker's default /dev/shm of 64 MB is too small for Chrome. Set shm_size: 2gb in Compose or --shm-size=2g in docker run. Also check the container's memory limit and the number of sessions per node, since several browsers in one container multiply memory use. Heavy pages or memory leaks in long sessions can also crash tabs, so restart sessions between test classes.
35

What is performance testing and what are its main types?

Save to ▾
Show answer
Performance testing checks how fast, stable and scalable a system is under a given workload. Load testing measures behaviour at expected traffic. Stress testing pushes beyond capacity to find the breaking point and how the system recovers. Spike testing applies sudden jumps in users. Soak or endurance testing runs normal load for hours to find leaks. Scalability testing checks whether adding resources increases capacity as expected.
36

What are Maven profiles and how do you use them in automation?

Save to ▾
Show answer
Profiles are sets of configuration activated by name, such as -Pqa or -Pstaging, or by conditions. In automation they switch environment URLs, suite files, browsers or parallel settings without changing code. For example a regression profile sets suiteXml to regression.xml and threadCount to 4. Combined with properties files, profiles keep one codebase for every environment.
37

Tell me about a time you worked with a team in a different location or time zone on automation.

Save to ▾
Show answer
Situation: our developers were in another time zone and test failures waited a day for replies. Task: reduce delays. Action: I wrote clear failure reports with screenshots, logs and steps, recorded short videos for complex issues, and set a fixed 30-minute overlap call twice a week. Result: turnaround on defects dropped from two days to about one, and fewer issues bounced back.
38

Write a declarative Jenkinsfile that runs Maven tests and publishes results.

Save to ▾
Show answer
pipeline { agent any parameters { choice(name: 'SUITE', choices: ['smoke', 'regression']) } stages { stage('Checkout') { steps { checkout scm } } stage('Test') { steps { sh "mvn clean test -DsuiteXml=${params.SUITE}.xml" } } } post { always { junit 'target/surefire-reports/*.xml' archiveArtifacts artifacts: 'target/screenshots/**', allowEmptyArchive: true } } }
39

Your CI pipeline is blocked because a downstream service needed for API tests is often down. What do you do?

Save to ▾
Show answer
Add a health check stage that pings dependencies before tests and marks the run as environment failure rather than test failure. For tests that do not need the real service, use stubs. Escalate with data on downtime frequency to the team owning the service. Keep a separate scheduled job for the real integration tests so pull requests are not blocked.
40

Your recorded JMeter script fails with 403 on every request after login. What is the likely cause?

Save to ▾
Show answer
The script is probably replaying hard-coded dynamic values, such as a CSRF token, session cookie or auth header captured during recording. The server rejects them because they belong to the old session. Add an HTTP Cookie Manager so cookies are handled per thread, extract the CSRF or bearer token from the login response with an extractor, and replace the recorded value with the variable. Verify with View Results Tree on one thread.

Frequently asked questions

What does a Performance Test Engineer do?

Plans, scripts and runs load, stress and soak tests for web applications and APIs, mainly with Apache JMeter, then analyses results with server monitoring to find bottlenecks. Builds realistic workload models with correlation, test data and think time, and runs tests in CI pipelines. Interviews test JMeter elements, correlation, percentiles and throughput, distributed and non-GUI runs, and how you explain results and risks to developers and managers.

Which skills are tested in a Performance Test Engineer interview?

Expect questions on Apache JMeter, Workload modelling, Correlation and parameterization, Results analysis, Monitoring and APM. Most rounds also ask you to explain a project and solve one practical problem live.

How do I prepare for a Performance Test Engineer interview?

Revise Performance Testing with JMeter, API Testing and CI/CD, Git, Maven and Jenkins first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.