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. "Read-only data structure shared across VUs efficiently" — in k6, this describes which of the following?
- A. Http_req_failed.
- B. HandleSummary().
- C. SharedArray.correct
- D. Vus.
Why: SharedArray: Read-only data structure shared across VUs efficiently.
2. "Runtime information about the executing scenario" — in k6, this describes which of the following?
- A. HandleSummary().
- B. K6 run script.js.
- C. Exec.scenario.correct
- D. --out influxdb=.
Why: exec.scenario: Runtime information about the executing scenario.
3. "Sends an HTTP GET request from the k6 http module" — in k6, this describes which of the following?
- A. Http.get().correct
- B. Vus.
- C. Exec.scenario.
- D. HandleSummary().
Why: http.get(): Sends an HTTP GET request from the k6 http module.
4. Which statement correctly describes k6?
- 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. Check() aborts the entire test immediately on the first failure.
- D. K6 can only run through a desktop GUI.
Why: Arrival-rate executors control requests per second independent of VU count.
5. "Total or per-VU count of scenario executions" — in k6, this describes which of the following?
- A. Http_req_failed.
- B. Constant-arrival-rate.
- C. Http_req_duration.
- D. Iterations.correct
Why: iterations: Total or per-VU count of scenario executions.
6. Identify the accurate statement about k6:
- A. Thresholds in k6 are decorative and can never fail a run.
- B. K6 scripts are written in JavaScript with a default exported function executed by each virtual user.correct
- C. K6 scripts are written exclusively in Java.
- D. Setup() runs before every single iteration of every VU.
Why: Each VU repeatedly runs the default function during the test.
7. "Built-in rate metric of failed requests" — in k6, this describes which of the following?
- A. --out influxdb=.
- B. Exec.scenario.
- C. Http_req_failed.correct
- D. Http.get().
Why: http_req_failed: Built-in rate metric of failed requests.
8. "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.
9. "Organizes related requests for structured results" — in k6, this describes which of the following?
- A. Http_req_duration.
- B. Group().correct
- C. --out influxdb=.
- D. SharedArray.
Why: group(): Organizes related requests for structured results.
10. "Custom end-of-test report generation hook" — in k6, this describes which of the following?
- A. Constant-arrival-rate.
- B. SharedArray.
- C. --out influxdb=.
- D. HandleSummary().correct
Why: handleSummary(): Custom end-of-test report generation hook.
11. Which of the following statements about k6 is TRUE?
- A. K6 scripts are written in JavaScript with a default exported function executed by each virtual user.correct
- B. Thresholds in k6 are decorative and can never fail a run.
- C. Custom metrics cannot be defined in k6.
- D. Check() aborts the entire test immediately on the first failure.
Why: Each VU repeatedly runs the default function during the test.
12. In k6, which of the following is described as: "Flag streaming results to a time-series database"?
- A. Exec.scenario.
- B. Http_req_failed.
- C. Iterations.
- D. --out influxdb=.correct
Why: --out influxdb=...: Flag streaming results to a time-series database.
13. In k6, which of the following is described as: "Built-in metric measuring full request time"?
- A. Http_req_duration.correct
- B. Exec.scenario.
- C. SharedArray.
- D. K6 run script.js.
Why: http_req_duration: Built-in metric measuring full request time.
14. Which k6 concept matches this description: "Sends an HTTP GET request from the k6 http module"?
- A. Http.get().correct
- B. Group().
- C. --out influxdb=.
- D. K6 run script.js.
Why: http.get(): Sends an HTTP GET request from the k6 http module.
15. In k6, which of the following is described as: "Sends an HTTP GET request from the k6 http module"?
- A. --out influxdb=.
- B. Iterations.
- C. Constant-arrival-rate.
- D. Http.get().correct
Why: http.get(): Sends an HTTP GET request from the k6 http module.
16. Which k6 concept matches this description: "Read-only data structure shared across VUs efficiently"?
- A. Http.get().
- B. SharedArray.correct
- C. HandleSummary().
- D. K6 run script.js.
Why: SharedArray: Read-only data structure shared across VUs efficiently.
17. In k6, which of the following is described as: "Read-only data structure shared across VUs efficiently"?
- A. Http_req_failed.
- B. K6 run script.js.
- C. Exec.scenario.
- D. SharedArray.correct
Why: SharedArray: Read-only data structure shared across VUs efficiently.
18. Which k6 concept matches this description: "Executor maintaining a fixed request rate regardless of response times"?
- A. SharedArray.
- B. Http_req_duration.
- C. Constant-arrival-rate.correct
- D. HandleSummary().
Why: constant-arrival-rate: Executor maintaining a fixed request rate regardless of response times.
19. In k6, which of the following is described as: "Runtime information about the executing scenario"?
- A. Iterations.
- B. K6 run script.js.
- C. Exec.scenario.correct
- D. Constant-arrival-rate.
Why: exec.scenario: Runtime information about the executing scenario.
20. Which k6 concept matches this description: "Runtime information about the executing scenario"?
- A. Exec.scenario.correct
- B. Http_req_failed.
- C. SharedArray.
- D. --out influxdb=.
Why: exec.scenario: Runtime information about the executing scenario.