k6 interview questions — Hard

325 hard-level k6 questions from our Performance Testing bank, each with the correct answer and an explanation of why it is correct.

What this covers

k6 appears throughout Performance Testing interviews. At hard level, interviewers are typically checking depth under pressure — edge cases, failure modes, performance characteristics, and the trade-offs you accepted. Work through these, then explain your answer out loud; the second part is what interviews actually test.

4 example questions

  1. 1. Which of the following statements about k6 is FALSE?

    • A. K6 is designed to run headlessly in CI/CD pipelines.
    • B. K6 requires launching a full browser instance per virtual user for HTTP tests.correct
    • C. Thresholds define pass/fail criteria like http_req_duration p(95)<500ms.
    • D. K6 can output results to InfluxDB, Prometheus, or Grafana Cloud for visualization.

    Why: The selected statement is false. The other options are accurate statements about k6.

  2. 2. Regarding k6, which of the following is a false statement?

    • A. K6 supports HTTP/1.1, HTTP/2, WebSocket, and gRPC protocols.
    • B. K6 scripts are written exclusively in Java.correct
    • C. K6 scripts are written in JavaScript with a default exported function executed by each virtual user.
    • D. The options object configures VUs, duration, stages, and thresholds.

    Why: The selected statement is false. The other options are accurate statements about k6.

  3. 3. Which statement about k6 is NOT correct?

    • A. Thresholds define pass/fail criteria like http_req_duration p(95)<500ms.
    • B. The sleep() function adds think time between iterations.
    • C. K6 can only run through a desktop GUI.correct
    • D. Scenarios and executors (e.g., ramping-vus, constant-arrival-rate) shape how load is generated.

    Why: The selected statement is false. The other options are accurate statements about k6.

  4. 4. Identify the INCORRECT statement about k6:

    • A. Environment variables are accessed in k6 via __ENV.
    • B. K6 requires launching a full browser instance per virtual user for HTTP tests.correct
    • C. Check() validates responses without stopping the test on failure.
    • D. K6 supports HTTP/1.1, HTTP/2, WebSocket, and gRPC protocols.

    Why: The selected statement is false. The other options are accurate statements about k6.

Related Performance Testing topics