k6 interview questions — Medium

643 medium-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 medium level, interviewers are typically checking that you have used it in practice: what you configured, what broke, and how you knew it worked. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. "Runtime information about the executing scenario" — in k6, this describes which of the following?

    • A. Iterations.
    • B. Exec.scenario.correct
    • C. K6 run script.js.
    • D. Constant-arrival-rate.

    Why: exec.scenario: Runtime information about the executing scenario.

  2. 2. "Flag streaming results to a time-series database" — in k6, this describes which of the following?

    • A. Constant-arrival-rate.
    • B. --out influxdb=.correct
    • C. Vus.
    • D. Iterations.

    Why: --out influxdb=...: Flag streaming results to a time-series database.

  3. 3. "Sends an HTTP GET request from the k6 http module" — in k6, this describes which of the following?

    • A. Http.get().correct
    • B. Http_req_duration.
    • C. Iterations.
    • D. Http_req_failed.

    Why: http.get(): Sends an HTTP GET request from the k6 http module.

  4. 4. "Executor maintaining a fixed request rate regardless of response times" — in k6, this describes which of the following?

    • A. Constant-arrival-rate.correct
    • B. Http_req_duration.
    • C. HandleSummary().
    • D. Group().

    Why: constant-arrival-rate: Executor maintaining a fixed request rate regardless of response times.

  5. 5. "Built-in metric measuring full request time" — in k6, this describes which of the following?

    • A. SharedArray.
    • B. HandleSummary().
    • C. --out influxdb=.
    • D. Http_req_duration.correct

    Why: http_req_duration: Built-in metric measuring full request time.

  6. 6. Which of the following statements about k6 is TRUE?

    • A. Scenarios and executors (e.g., ramping-vus, constant-arrival-rate) shape how load is generated.correct
    • B. K6 scripts are written exclusively in Java.
    • C. Custom metrics cannot be defined in k6.
    • D. Check() aborts the entire test immediately on the first failure.

    Why: Arrival-rate executors control requests per second independent of VU count.

  7. 7. "Total or per-VU count of scenario executions" — in k6, this describes which of the following?

    • A. Group().
    • B. Exec.scenario.
    • C. Iterations.correct
    • D. Http.get().

    Why: iterations: Total or per-VU count of scenario executions.

  8. 8. "Built-in rate metric of failed requests" — in k6, this describes which of the following?

    • A. Http.get().
    • B. Http_req_failed.correct
    • C. Constant-arrival-rate.
    • D. Iterations.

    Why: http_req_failed: Built-in rate metric of failed requests.

  9. 9. Which statement correctly describes k6?

    • A. Custom metrics cannot be defined in k6.
    • B. K6 can only run through a desktop GUI.
    • C. Thresholds in k6 are decorative and can never fail a run.
    • D. K6 is designed to run headlessly in CI/CD pipelines.correct

    Why: A single binary and code-based tests fit pipelines naturally.

  10. 10. "CLI command executing a test script" — in k6, this describes which of the following?

    • A. K6 run script.js.correct
    • B. Group().
    • C. HandleSummary().
    • D. SharedArray.

    Why: k6 run script.js: CLI command executing a test script.

  11. 11. Identify the accurate statement about k6:

    • A. K6 scripts are written exclusively in Java.
    • B. K6 scripts are written in JavaScript with a default exported function executed by each virtual user.correct
    • C. Setup() runs before every single iteration of every VU.
    • D. Custom metrics cannot be defined in k6.

    Why: Each VU repeatedly runs the default function during the test.

  12. 12. In k6, which of the following is described as: "Built-in metric measuring full request time"?

    • A. Constant-arrival-rate.
    • B. Http_req_duration.correct
    • C. Http.get().
    • D. Vus.

    Why: http_req_duration: Built-in metric measuring full request time.

  13. 13. In k6, which of the following is described as: "Flag streaming results to a time-series database"?

    • A. SharedArray.
    • B. Iterations.
    • C. Http_req_failed.
    • D. --out influxdb=.correct

    Why: --out influxdb=...: Flag streaming results to a time-series database.

  14. 14. In k6, which of the following is described as: "Read-only data structure shared across VUs efficiently"?

    • A. Http_req_failed.
    • B. Exec.scenario.
    • C. SharedArray.correct
    • D. Group().

    Why: SharedArray: Read-only data structure shared across VUs efficiently.

  15. 15. In k6, which of the following is described as: "Sends an HTTP GET request from the k6 http module"?

    • A. Constant-arrival-rate.
    • B. Http.get().correct
    • C. Http_req_failed.
    • D. K6 run script.js.

    Why: http.get(): Sends an HTTP GET request from the k6 http module.

  16. 16. In the context of k6, which of the following is a correct statement?

    • A. Custom metrics cannot be defined in k6.
    • B. K6 scripts are written in JavaScript with a default exported function executed by each virtual user.correct
    • C. K6 requires launching a full browser instance per virtual user for HTTP tests.
    • D. K6 scripts are written exclusively in Java.

    Why: Each VU repeatedly runs the default function during the test.

  17. 17. Which k6 concept matches this description: "Read-only data structure shared across VUs efficiently"?

    • A. Exec.scenario.
    • B. SharedArray.correct
    • C. --out influxdb=.
    • D. HandleSummary().

    Why: SharedArray: Read-only data structure shared across VUs efficiently.

  18. 18. Which k6 concept matches this description: "Sends an HTTP GET request from the k6 http module"?

    • A. Http.get().correct
    • B. Http_req_failed.
    • C. Iterations.
    • D. Vus.

    Why: http.get(): Sends an HTTP GET request from the k6 http module.

  19. 19. In k6, which of the following is described as: "Executor maintaining a fixed request rate regardless of response times"?

    • A. Constant-arrival-rate.correct
    • B. Vus.
    • C. Iterations.
    • D. HandleSummary().

    Why: constant-arrival-rate: Executor maintaining a fixed request rate regardless of response times.

  20. 20. Which k6 concept matches this description: "Total or per-VU count of scenario executions"?

    • A. Constant-arrival-rate.
    • B. Iterations.correct
    • C. Http_req_duration.
    • D. --out influxdb=.

    Why: iterations: Total or per-VU count of scenario executions.

Related Performance Testing topics