Performance Testing and JMeter Interview Questions
Last updated 2026-11-19
Performance testing interviews mix theory (what is the difference between load and stress testing, why percentiles beat averages) with tool skills (building a JMeter plan, correlating dynamic values, running headless in CI) and analysis (reading a result and naming the bottleneck). This page has 15 worked questions with the arithmetic done, such as Little's Law and throughput calculations, plus JMeter commands and a Groovy snippet.
Examples use Apache JMeter 5.x. The same principles apply to k6, Gatling and Locust. For related reading see the API testing questions, the automation testing questions and the SRE questions, and for interview strategy how to crack a QA testing interview.
| Test types | Load, stress, spike, soak (endurance), scalability, volume |
|---|---|
| Key metrics | Response time percentiles, throughput, error rate, concurrency, resource utilisation |
| JMeter basics | Test plan, thread group, samplers, config elements, timers, assertions, listeners, CLI mode |
The arithmetic interviewers like
Little's Law connects concurrency, throughput and response time: concurrent users in the system equals throughput multiplied by the time each spends there. If a system must serve 200 requests per second and each takes 0.5 seconds, about 100 requests are in flight. For users with think time, number of users equals throughput multiplied by the sum of response time and think time. With 500 users, a 1 second response time and 9 seconds of think time, the throughput is 500 divided by 10, so 50 requests per second. If a plan with 500 threads gets only 30 requests per second, your response times or think time are larger than assumed, or the system is saturating.
Performance Testing and JMeter Interview Questions: questions with worked answers
1 What is the difference between load, stress, spike, soak and scalability testing?
easyLoad testing applies the expected realistic load to check that response times and error rates meet targets. Stress testing pushes beyond capacity to find the breaking point and see how the system fails and recovers. Spike testing applies a sudden large jump in users to test elasticity and queueing. Soak or endurance testing holds a steady load for hours to expose memory leaks, connection exhaustion and log or disk growth. Scalability testing increases load, and resources, in steps to learn how throughput scales. Volume testing uses large data sets. Each has a different question: does it meet the SLA, where does it break, can it absorb a surge, does it degrade over time.
2 Why are percentiles better than averages for response time?
mediumAverages hide the tail. If 95 requests take 100 ms and 5 take 5 seconds, the mean is 345 ms, which looks acceptable while 5 percent of users wait five seconds. The 95th and 99th percentiles show what the slowest slice experiences, and in systems where one page makes many calls the slow tail affects most page loads. Report median, p90, p95 and p99, plus maximum and error rate, and define the SLA in percentiles, for example p95 below 800 ms. Plot response time over time to see degradation as load grows, not only a single number.
3 Explain throughput, concurrency and think time, and how to size a test from business numbers.
mediumThroughput is requests or transactions completed per second. Concurrency is the number of users or requests active at once. Think time is the pause a real user takes between actions. To size a test, start from business data: say 36,000 orders in the busiest hour is 10 per second. If a checkout journey has 6 requests, that is 60 requests per second at peak, and a 1.5 times safety margin gives 90. Use Little's Law with expected response and think time to derive the user count. Then model the workload mix, for example 70 percent browse, 20 percent search and 10 percent checkout, instead of hitting a single endpoint.
4 What are the main elements of a JMeter test plan?
easyThe test plan contains thread groups, where each thread simulates a user, with settings for number of threads, ramp-up period and loop count or duration. Samplers send requests (HTTP Request, JDBC, JSR223). Logic controllers organise flow (loop, if, transaction, random). Config elements supply defaults and data (HTTP Request Defaults, HTTP Cookie Manager, CSV Data Set Config, User Defined Variables). Timers add pauses and pacing (constant, uniform random, constant throughput). Pre- and post-processors prepare requests and extract values. Assertions check responses. Listeners collect and display results, and are used sparingly under load.
5 How do ramp-up period, thread count and loop count interact?
easyThe ramp-up period is the time JMeter takes to start all threads, so 100 threads with a 50 second ramp-up start two threads per second. Loop count is how many times each thread repeats the sampler sequence, or you can set a duration, and by default threads stop when their loops end. A common mistake is a ramp-up of zero, which hits the server with all users at once, a spike rather than a load test. Peak concurrency is only reached once ramp-up completes, so measure the steady-state window after it and exclude ramp-up and ramp-down from reported results.
6 What is correlation in JMeter, and how do you handle a dynamic session token?
mediumCorrelation is capturing a dynamic value from one response, such as a session ID, CSRF token or order number, and passing it into later requests, because replaying the recorded constant would fail. Add a post-processor to the request that returns the value: a Regular Expression Extractor, JSON Extractor or Boundary Extractor, storing it into a variable, then reference it as a variable in later requests. Add an assertion to confirm the extraction succeeded. Parameterisation is different: replacing fixed inputs, such as usernames, with data from a CSV file.
textJSON Extractor (child of POST /login) Names of created variables : authToken JSON Path expressions : $.accessToken Match No. : 1 Default value : TOKEN_NOT_FOUND HTTP Header Manager (applies to later requests) Authorization : Bearer ${authToken} Response Assertion on the next request Field to test : Response Code Pattern : 2007 How do you run a JMeter test from the command line, and why should you?
mediumThe GUI is for building and debugging; running load from it consumes memory and CPU and distorts results. Run in non-GUI mode with -n, pass the plan with -t, write raw results with -l, and generate the HTML dashboard with -e -o into an empty folder. Parameters are passed with -J and read in the plan with the P function. For CI, run it as a pipeline step and fail the build on thresholds using the results file or a plugin. Disable heavy listeners such as View Results Tree during load.
bashjmeter -n -t checkout.jmx -l results.jtl -Jusers=200 -Jrampup=120 -Jduration=900 -e -o report/ # in the plan: threads = ${__P(users,50)}, ramp-up = ${__P(rampup,60)}, duration = ${__P(duration,600)} # quick p95 from a CSV results file (elapsed is column 2) awk -F, 'NR>1 {print $2}' results.jtl | sort -n | awk '{a[NR]=$1} END {print "p95:", a[int(NR*0.95)]}'8 How do you generate load that exceeds one machine's capacity in JMeter?
hardUse distributed testing: a controller coordinates several remote JMeter servers (agents), each running the same plan with the configured thread count, so total users are threads times agents. Each agent needs the same JMeter version, test data files and network access to the target, and the controller needs RMI connectivity, ideally with SSL configured. Before scaling out, tune a single machine: more heap, fewer listeners, CSV data in memory and checking that the load generator CPU stays below about 70 to 80 percent, otherwise you are measuring the generator. Cloud-based load services and Kubernetes-based setups are alternatives.
bash# on each agent jmeter-server # on the controller jmeter -n -t checkout.jmx -R 10.0.0.11,10.0.0.12,10.0.0.13 -l results.jtl -e -o report/9 What are assertions and timers used for, and what does a Constant Throughput Timer do?
mediumAssertions verify that responses are correct, so a fast error page is not counted as success: response code, response text, JSON content or duration. Without them, a test can show excellent response times while returning 500 errors. Timers add delays between samplers to model think time; without timers, threads fire as fast as the server responds, which overstates load per user. The Constant Throughput Timer paces threads to reach a target number of samples per minute, useful for holding a fixed request rate regardless of response time, though it can only slow threads down, so you need enough threads to reach the target. Newer plans often use the Throughput Controller or a precise throughput timer.
10 A test shows response time rising steadily and errors beginning at 300 users. How do you find the bottleneck?
hardCorrelate the load generator results with server-side metrics over the same time window. Check CPU, memory, garbage collection, disk IO and network on the application and database servers, then application metrics such as thread pool and connection pool saturation, queue lengths and slow query logs. A flat CPU with rising latency suggests waiting on a lock, an exhausted connection pool or a slow downstream. High CPU suggests inefficient code or insufficient capacity. Use an APM or profiler to find hot methods and distributed traces to find the slow service. Change one thing at a time and re-run, because multiple changes hide causes.
11 What is the difference between response time and latency, and what is TTFB?
mediumIn JMeter, elapsed time is measured from just before sending the request to the end of the response, including connect time, sending, server processing and receiving. Latency is measured from before sending the request until the first byte of the response arrives, so it includes network delay and server processing but not the download. Time to first byte is the same idea seen from a browser. Connect time measures the TCP and TLS handshake. Comparing latency to total elapsed time shows whether slowness is in server thinking or in transferring a large payload.
12 How do you handle test data in a load test, for example unique logins?
mediumUse a CSV Data Set Config reading usernames, passwords and other inputs, with sharing mode set so each thread gets distinct rows, and recycle on end of file only if reuse is valid for the system. Make sure the pool is large enough that sessions do not collide, and pre-load the target database with realistic volumes, because queries on empty tables misrepresent production. For writes, generate unique values with functions such as the random string or UUID functions, and plan cleanup or an environment reset. Avoid test data that makes caches unrealistically warm, such as everyone requesting the same product.
13 Write a JSR223 Groovy snippet to compute a value and use it in the plan.
hardJSR223 elements run Groovy, which JMeter compiles and caches when the compilation caching option is enabled, so it is far faster than the old BeanShell elements. Use it for custom logic such as signing a request or building a payload. Read and write JMeter variables through vars, and the previous response through prev. Keep scripts small, avoid heavy logic in the load path, and tick cache compiled script in the element.
groovyimport java.security.MessageDigest def ts = System.currentTimeMillis().toString() def payload = vars.get('orderId') + ts def sig = MessageDigest.getInstance('SHA-256') .digest(payload.getBytes('UTF-8')) .encodeHex().toString() vars.put('timestamp', ts) vars.put('signature', sig) log.info('signature computed for ' + vars.get('orderId'))14 JMeter versus k6, Gatling and Locust: how do you choose?
mediumJMeter has a GUI, a huge plugin ecosystem and protocol breadth (HTTP, JDBC, JMS, FTP, LDAP), but XML plans are clumsy in version control and threads are heavy per user. k6 uses JavaScript scripts, is lightweight, built around thresholds and a good CI fit. Gatling uses a Scala, Java or Kotlin DSL with an efficient asynchronous engine and detailed reports. Locust is Python-based, easy to extend and distribute. Choose JMeter for protocol variety and teams who prefer a GUI, and code-first tools when load tests live in the same repository as the application and run in pipelines.
15 How do you include performance testing in a continuous delivery pipeline?
mediumRun a small, fast performance smoke test on each build against a stable environment, with thresholds on p95 latency and error rate that fail the pipeline on regression, and run the heavier load, stress and soak tests nightly or before releases. Keep the environment, dataset and test script versioned so results are comparable run to run, store trends to spot gradual drift, and monitor the system under test during the run. Use production-like sizing for meaningful capacity numbers, and treat results from a smaller environment as relative comparisons only.
Frequently asked questions
Do I need to code to do performance testing?
JMeter can be used with little code, but real projects need scripting for correlation and custom logic, in Groovy, or code-first tools such as k6 (JavaScript) and Locust (Python). Understanding systems and metrics matters more than syntax.
What is the difference between performance testing and performance engineering?
Testing measures behaviour under load and reports results. Engineering goes further: diagnosing bottlenecks, tuning code, queries and infrastructure, and building performance into design and monitoring.
Can JMeter test a browser UI?
JMeter works at the protocol level, sending HTTP requests, and does not execute JavaScript or render pages. It therefore measures server and network response, not browser rendering time; use tools like Lighthouse or WebPageTest for front-end performance.
What should a performance test report contain?
Objectives and workload model, environment and data, results with percentiles, throughput, error rate and resource use over time, identified bottlenecks, comparison with targets, and recommendations. Include the exact test configuration so it can be repeated.
Related guides
More in Role-wise Interview Questions by Job and Tech Stack
- Power BI Interview Questions and Answers
- Probability for Data Science Interview Questions and Answers
- Product Analyst Interview Questions and Answers
- PySpark Interview Questions and Answers
- React Hooks Interview Questions and Answers
- React Interview Questions and Answers (React 19)
- React Native Interview Questions and Answers
- Redux Interview Questions and Answers (Redux Toolkit)
- SDET Interview Questions and Answers
- Selenium Interview Questions and Answers
- Site Reliability Engineer (SRE) Interview Questions and Answers
- SOC Analyst Interview Questions and Answers