Advanced k6 Interview Questions: Executors to v2 (2027)
26 advanced k6 interview questions on arrival-rate executors, thresholds, extensions and xk6, k6 v2, browser tests, the k6 Operator and OpenTelemetry.
Advanced k6 interview questions test whether you can model real traffic with arrival-rate executors, set thresholds that fail a pipeline for the right reasons, extend k6 with extensions, mix browser and protocol tests, and run distributed load on Kubernetes with the k6 Operator. Expect fewer definitions and more design trade-offs. This page has 26 questions for engineers with two or more years of load testing experience, followed by scenarios.
Everything here was checked against the Grafana k6 documentation and the k6 GitHub releases page in November 2026. At that point the current major line was k6 v2 (v2.4.0 was the latest release listed), with v1.8.x kept as a maintenance line.
Key takeaways
- k6 has six executors. Senior candidates are expected to explain why
constant-arrival-rateandramping-arrival-ratemodel open workloads and the VU-based executors model closed ones. - Thresholds decide whether a run passes. Know the long form with
abortOnFailanddelayAbortEval, and tag-filtered sub-metric thresholds. - k6 v2.0.0 removed many deprecated commands and APIs and moved the Go module path to
go.k6.io/k6/v2, which matters to anyone who maintains extensions. - Since k6 v1.2.0, official and community extensions can be resolved automatically from an import. Private extensions still need a custom binary built with xk6.
- The k6 Operator runs distributed tests through a
TestRuncustom resource with aparallelismfield. - The built-in InfluxDB and Prometheus remote-write outputs are deprecated and slated for removal in k6 v3. The OpenTelemetry output is the recommended path.
How this page fits with the other k6 guides
If you are new to k6, start with our k6 engineer interview questions, which is the main guide in this series, and the most asked k6 scripting questions. This page assumes you already write k6 scripts comfortably. It goes into workload modeling, the v2 changes, extensions and distributed runs. Workload scenarios are covered in more depth in scenario-based k6 questions, and reading results is covered in real-time k6 questions on test results.
| Topic | Questions | What the interviewer listens for |
|---|---|---|
| Workload modeling and executors | 1 to 7 | Open versus closed models, VU sizing |
| Thresholds and lifecycle | 8 to 13 | Pass and fail logic, setup data |
| Extensions and k6 v2 | 14 to 18 | Upgrade awareness, custom binaries |
| Browser, distributed runs, outputs | 19 to 26 | Hybrid tests, Operator, OpenTelemetry |
Workload modeling and executors
1. Name the six k6 executors and group them.
The documentation lists shared-iterations, per-vu-iterations, constant-vus, ramping-vus, constant-arrival-rate and ramping-arrival-rate. The first two are iteration-based: you give k6 a number of iterations and it stops when they are done. The next two hold or change a number of virtual users for a period of time, and each VU loops as fast as it can. The last two start iterations at a given rate, regardless of how long each iteration takes.
2. What is the difference between an open and a closed workload model?
In a closed model, a fixed pool of users sends the next request only after the previous one returns. When the system slows down, the request rate falls with it, so the test quietly takes pressure off exactly when the system is struggling. The VU-based executors behave like this. In an open model, new work arrives at a rate set by the outside world, the way real customers arrive at a website whether or not it is slow. The arrival-rate executors behave like this, and they are the better choice when the question is "what happens at 300 requests per second?"
3. How do you size preAllocatedVUs for an arrival-rate test?
Each iteration occupies a VU for as long as it runs. If you want 200 iterations per second and an iteration takes about half a second end to end, you need roughly 100 VUs busy at any moment, plus headroom for slow periods. Set preAllocatedVUs near that number and maxVUs higher. If k6 runs out of VUs it cannot start iterations on time and reports dropped iterations, which means the generator, not the system under test, limited the rate. A good answer mentions checking the dropped_iterations metric after every run.
4. When is shared-iterations a poor choice?
It splits a fixed number of iterations across VUs, so fast VUs take more of them. That is fine for seeding data or a smoke test. It is a poor choice for measuring performance because the duration of the test depends on how fast the system answers, and you cannot say what load was applied over time.
5. How do you run two different traffic shapes in one test?
Define several entries under options.scenarios, each with its own executor, its own exec function and optional startTime. A typical design runs a constant arrival rate of browsing traffic while a second scenario ramps up checkout traffic. Each scenario's metrics carry a scenario tag, so you can set thresholds per scenario.
6. Why can ramping VUs give misleading capacity numbers?
Because throughput is an output of a VU test, not an input. If latency doubles, the same number of VUs produce half the requests, and the graph can look as if the system handled the "peak" when it actually received far fewer requests than expected. Interviewers like candidates who check achieved request rate against the intended one before they report a capacity figure.
7. How do you make think time realistic without wrecking the rate?
With VU-based executors, sleep() between steps is how you simulate a user reading a page. With arrival-rate executors, sleep inside an iteration only lengthens it and raises the VUs you need, because the start rate is fixed. Many teams keep think time in user-journey tests and drop it in pure API throughput tests.
export const options = {
scenarios: {
browse: {
executor: 'constant-arrival-rate',
rate: 200,
timeUnit: '1s',
duration: '10m',
preAllocatedVUs: 120,
maxVUs: 300,
exec: 'browse',
},
checkout: {
executor: 'ramping-arrival-rate',
startRate: 5,
timeUnit: '1s',
preAllocatedVUs: 20,
maxVUs: 100,
stages: [
{ target: 30, duration: '5m' },
{ target: 30, duration: '5m' },
],
exec: 'checkout',
},
},
};
Thresholds and the test lifecycle
8. How are thresholds written, and what types of aggregation are allowed?
Thresholds sit under options.thresholds, keyed by metric name, with one or more expressions of the form aggregation, operator, value, such as p(95) < 500. The allowed aggregation depends on the metric type: trends accept avg, min, max, med and percentiles, rates accept rate, counters accept count and rate, and gauges accept value. If an expression is false at the end of the run, k6 marks the test as failed and exits with a non-zero code, which is what lets a CI job fail.
9. What do abortOnFail and delayAbortEval do?
The long form of a threshold is an object. abortOnFail: true stops the run as soon as the threshold fails, instead of waiting for the end, which saves time and protects a shared environment. delayAbortEval postpones evaluation (for example by '1m') so a few slow warm-up requests do not abort the run. The docs also note that in cloud runs thresholds are evaluated every 60 seconds, so an abort can arrive up to a minute late.
10. How do you set a threshold on only part of the traffic?
Tag the requests and use a sub-metric key. For example 'http_req_duration{type:API}' applies only to requests sent with tags: { type: 'API' }. Group durations work the same way. One trap worth mentioning: if you define the same metric key twice in the thresholds object, JavaScript keeps only the last one, so put all expressions for a metric in one array.
export const options = {
thresholds: {
http_req_failed: ['rate<0.01'],
'http_req_duration{type:API}': [
{ threshold: 'p(95)<400', abortOnFail: true, delayAbortEval: '1m' },
],
dropped_iterations: ['count<10'],
},
};
11. Explain the four lifecycle stages.
The init stage runs once per VU and holds imports, options and file loading. It cannot make HTTP requests. setup() runs once before the load starts and can call APIs, for example to create test users or fetch a token. The VU function, usually default, runs repeatedly and is the only part that produces the load. teardown() runs once at the end for cleanup. A senior answer adds that the VU stage cannot load local files, so test data must be opened in init.
12. How does data move from setup() to the VUs, and what are the limits?
Whatever setup() returns is passed to default() and teardown() as an argument. It must be JSON-serializable, so functions do not survive, and every VU receives its own copy, so changes made in one VU are not seen elsewhere. Large setup data costs memory on every VU. setup() must also finish within setupTimeout, 60 seconds by default, or the test fails before any VU starts.
13. What happens if setup() throws?
The test stops and teardown() does not run. If setup created resources before it failed, nothing cleans them up. Good scripts wrap setup steps in error handling and record what they created so a separate job can remove it.
Extensions and the k6 v2 changes
14. What kinds of k6 extensions exist?
The documentation names four types: JavaScript extensions that add modules to scripts, output extensions that send metrics somewhere new, secret source extensions, and subcommand extensions that add commands under k6 x. JavaScript extensions are imported from paths that start with k6/x/.
15. How does automatic extension resolution work?
From k6 v1.2.0 onward, you import an official or community extension in the script, for example k6/x/faker, and run the script normally. k6 detects the import and provisions a binary that includes it. There are limits: output extensions are not covered, scripts cannot come from standard input, and only .js, .ts or .tar files work. Setting K6_AUTO_EXTENSION_RESOLUTION=false turns the feature off.
16. When do you still need xk6?
For any extension that is not listed as official or community, including private extensions your team writes. You build a custom k6 binary with xk6 build --with <module>@<version>, either with a local Go toolchain or the grafana/xk6 container image. In CI you usually build this binary once, publish it as an artifact or image, and pin the version so every pipeline tests with the same code.
xk6 build \
--with github.com/grafana/[email protected] \
--with github.com/grafana/xk6-output-influxdb
17. What changed in k6 v2 that an extension maintainer must handle?
v2.0.0 removed many deprecated commands, flags and APIs and changed the Go module path to go.k6.io/k6/v2, so extensions must update their imports. The experimental Redis module was removed in favour of the k6/x/redis extension. v2.4.0 also changed how nil slices and some values convert into JavaScript, and the release notes ask extension authors to review code that depends on that behaviour.
18. Your team is on k6 v1.8. Should you upgrade?
The releases page shows v1.8.x still receiving patch releases, such as v1.8.3 with security updates, while v2.x gets new features. A practical answer: upgrade a copy of the test suite first, run it against a stable environment, compare results with the v1 baseline, fix removed flags in CI scripts, and rebuild any custom binaries against the v2 module path. Then move the pipelines.
Browser tests, distributed runs and outputs
19. How do you write a browser test in k6?
Import browser from k6/browser and set options.browser.type to 'chromium' inside the scenario options. The machine running k6 needs a Chromium-based browser. k6 new --template browser creates a starter script. Browser tests are expensive per VU, so they run with a handful of VUs and measure front-end metrics such as page load, while protocol-level scenarios generate the bulk of the load.
import { browser } from 'k6/browser';
export const options = {
scenarios: {
ui: {
executor: 'shared-iterations',
options: { browser: { type: 'chromium' } },
},
},
};
export default async function () {
const page = await browser.newPage();
try {
await page.goto('https://test.k6.io/');
} finally {
await page.close();
}
}
20. What is a hybrid test and why use one?
A hybrid test runs a large protocol scenario that loads the backend and a small browser scenario at the same time. The browser scenario shows what a real user experiences while the backend is busy, which neither test shows alone. If browser_data_received is part of your thresholds, note that v2.4.0 changed it to use Chrome's encoded transfer size, so older limits may need recalibrating.
21. How does the k6 Operator run a distributed test?
You install the operator in the cluster and apply a TestRun resource (API version k6.io/v1alpha1). It points at the script, sets the runner environment and sets parallelism, the number of pods the test is split across. The operator creates the jobs and divides the workload between pods using execution segments, so a rate of 1,000 iterations per second with four pods becomes roughly 250 per pod.
apiVersion: k6.io/v1alpha1
kind: TestRun
metadata:
name: checkout-load
spec:
parallelism: 4
script:
configMap:
name: checkout-test
file: test.js
arguments: --tag testid=checkout-2027-01
cleanup: post
22. What limits apply to scripts in the Operator?
A ConfigMap holds at most 1 MiB, so larger scripts or data files go on a PersistentVolume, where the operator expects them under /test/. The ConfigMap or claim must be in the same namespace as the TestRun. cleanup: post removes the resources after the run, which is helpful when results already stream to an external backend.
23. Why do thresholds behave differently in a distributed run?
Each pod only sees its own share of the metrics. A percentile computed on one pod is not the percentile of the whole test. For a trustworthy pass or fail decision, send metrics to one backend and evaluate there, or use a service that aggregates across instances. Mention this unprompted and you will stand out.
24. Which output should you use for long-term metrics?
The release notes for v2.4.0 deprecate the built-in InfluxDB and Prometheus remote-write outputs and plan their removal in k6 v3, recommending the opentelemetry output. You enable it with -o opentelemetry. The gRPC exporter is the default and points at localhost:4317 unless you set K6_OTEL_GRPC_EXPORTER_ENDPOINT. For HTTP, set K6_OTEL_EXPORTER_PROTOCOL=http/protobuf and K6_OTEL_HTTP_EXPORTER_ENDPOINT.
K6_OTEL_GRPC_EXPORTER_ENDPOINT=otel-collector:4317 \
K6_OTEL_GRPC_EXPORTER_INSECURE=true \
k6 run --tag testid=nightly -o opentelemetry script.js
25. How do you tie a run to dashboards and traces?
Add a unique tag such as testid with --tag so every metric from the run can be filtered. v2.4.0 also added experimental native tracing, with spans for the run, scenarios, VUs and iterations. Treat experimental features as optional in an interview answer and say so.
26. How do you keep secrets out of debug logs?
Use environment variables or a secret source rather than hard-coded tokens, and when you need HTTP debug output, add --http-debug-redact, which v2.4.0 introduced to mask credential headers in HTTP and gRPC logs.
Scenario questions
Scenario 1: The test passed, but production fell over at the same traffic.
Start by checking what load the test actually applied. If it used ramping VUs, compare the achieved request rate with the production rate; a slow system under a closed model receives less traffic than planned. Then compare the data set. Tests that reuse ten user accounts hit warm caches that production never sees. Rerun with an arrival-rate executor at the production rate, a realistic data spread and a threshold on dropped_iterations so the generator cannot hide a shortfall.
Scenario 2: The run reports many dropped iterations.
The generator ran out of VUs. Either iterations got slower (look at iteration_duration) or maxVUs is too low. Raise maxVUs if the load generator has spare CPU and memory. If the generator machine itself is saturated, split the test across more machines or Operator pods rather than pushing one box harder, because a saturated generator adds its own latency to every measurement.
Scenario 3: A pipeline must stop deploying when the API gets slower.
Add a short smoke-level k6 stage after deployment to staging with thresholds on error rate and p95 latency for the API tag, using abortOnFail with a one-minute delayAbortEval. k6 exits non-zero when a threshold fails, so the CI job fails and the promotion step never runs. Keep the long soak and stress tests on a schedule rather than in every pipeline.
Scenario 4: Security asks you to load test a service that needs a private extension.
Build a custom binary with xk6 in a controlled pipeline, pin the extension version, scan the resulting image like any other dependency, and store it in your internal registry. Turn off automatic extension resolution in that pipeline so the run cannot fetch anything else at test time.
How to prepare
Write one script that uses two scenarios with different executors, run it locally, then run it again with the opposite executor type and compare the achieved rates. Break a threshold on purpose to see the exit code. If you have access to a Kubernetes cluster, install the k6 Operator and split the same script across two pods. Practise explaining each result in two or three sentences, because that is what interviews reward. For the wider monitoring stack these metrics land in, our Prometheus and Grafana training covers dashboards and alerting, and the 200 DevOps interview questions guide covers the rest of a DevOps interview loop.
Frequently asked questions
Is there an official k6 certification?
No. There is no official k6 certification, so employers judge k6 skill through interviews and practical tasks. Our k6 certification questions page explains this in more detail.
Which executor should I use for capacity testing?
Use constant-arrival-rate or ramping-arrival-rate, because they hold the request start rate steady even when the system slows down.
What is the latest k6 version?
In November 2026 the GitHub releases page listed v2.4.0 as the latest release, with v1.8.x maintained as a separate patch line.
Do I need xk6 to use extensions?
Not for official or community extensions on k6 v1.2.0 or later, which resolve automatically from the import. Private extensions still need an xk6 build.
How do I run k6 across several machines?
On Kubernetes, use the k6 Operator with a TestRun resource and set parallelism to the number of pods.
Should I still use the Prometheus remote-write output?
It still works, but v2.4.0 deprecated it with removal planned for k6 v3. New setups should use the OpenTelemetry output.
References
- k6 documentation: Executors
- k6 documentation: Scenarios
- k6 documentation: Built-in metrics reference
- k6 documentation: Thresholds
- k6 documentation: Test lifecycle
- k6 documentation: Extensions
- k6 documentation: Running extensions
- k6 documentation: k6/browser
- k6 documentation: Running distributed tests
- k6 documentation: OpenTelemetry output
- grafana/k6 releases on GitHub
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0