Karate interview questions — Medium

207 medium-level Karate questions from our API Testing bank, each with the correct answer and an explanation of why it is correct.

What this covers

Karate appears throughout API 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. "Global configuration returning environment variables" — in Karate, this describes which of the following?

    • A. #uuid.
    • B. Karate-config.js.correct
    • C. Background:.
    • D. Karate.repeat.

    Why: karate-config.js: Global configuration returning environment variables.

  2. 2. While onboarding a junior QA, you explain: Which Karate keyword does powerful (fuzzy/schema) comparison?

    • A. Assert.
    • B. Verify.
    • C. Match.correct
    • D. Check.

    Why: Karate's 'match' supports exact, contains, and schema markers.

  3. 3. "Steps run before each scenario in a Karate feature" — in Karate, this describes which of the following?

    • A. Gatling integration.
    • B. Karate-config.js.
    • C. Background:.correct
    • D. Def.

    Why: Background:: Steps run before each scenario in a Karate feature.

  4. 4. "Utility generating arrays for data-driven loops" — in Karate, this describes which of the following?

    • A. Background:.
    • B. Gatling integration.
    • C. Karate.repeat.correct
    • D. Karate-config.js.

    Why: karate.repeat: Utility generating arrays for data-driven loops.

  5. 5. "Reusing Karate tests as performance tests via Karate-Gatling" — in Karate, this describes which of the following?

    • A. Background:.
    • B. Status 200.
    • C. Gatling integration.correct
    • D. Karate-config.js.

    Why: gatling integration: Reusing Karate tests as performance tests via Karate-Gatling.

  6. 6. During a sprint demo, a teammate asks: A defining feature of Karate is:

    • A. Heavy Java step code.
    • B. SOAP only.
    • C. Gherkin syntax with no glue code needed.correct
    • D. No assertions.

    Why: Karate runs Gherkin features directly with built-in HTTP/assert steps.

  7. 7. Which Karate keyword performs a powerful (including fuzzy/schema) comparison of a response?

    • A. Assert.
    • B. Match.correct
    • C. Verify.
    • D. Check.

    Why: Karate's 'match' keyword does deep, flexible comparisons (exact, contains, schema/markers like '#string', '#number').

  8. 8. Which statement correctly describes Karate?

    • A. Karate requires writing Java step definitions for every Gherkin step.
    • B. Karate has no support for data-driven scenarios.
    • C. Karate combines API testing, mocking, and assertions in Gherkin-like feature files without step definitions.correct
    • D. JavaScript cannot be used inside Karate tests.

    Why: Karate's DSL is directly executable; no glue code is required.

  9. 9. Which of the following statements about Karate is TRUE?

    • A. Karate.forEach and karate-config.js provide looping and centralized configuration.correct
    • B. The match keyword can only compare exact string values.
    • C. Karate feature files cannot call or reuse other feature files.
    • D. Karate requires writing Java step definitions for every Gherkin step.

    Why: karate-config.js sets environment-specific variables globally.

  10. 10. "Keywords composing the request endpoint" — in Karate, this describes which of the following?

    • A. Gatling integration.
    • B. Url / path.correct
    • C. Def.
    • D. Karate-config.js.

    Why: url / path: Keywords composing the request endpoint.

  11. 11. Identify the accurate statement about Karate:

    • A. JavaScript cannot be used inside Karate tests.
    • B. Karate cannot mock or simulate API endpoints.
    • C. Karate combines API testing, mocking, and assertions in Gherkin-like feature files without step definitions.correct
    • D. Karate feature files cannot call or reuse other feature files.

    Why: Karate's DSL is directly executable; no glue code is required.

  12. 12. A defining feature of the Karate framework is that…

    • A. You must write extensive Java step definitions.
    • B. Tests are written in Gherkin-style syntax with no Java/step-definition code required.correct
    • C. It only tests SOAP services.
    • D. It cannot do assertions.

    Why: Karate combines API testing and BDD: you write Gherkin feature files directly, and it provides built-in HTTP and assertion steps with no glue code.

  13. 13. "Defines a variable in a Karate scenario" — in Karate, this describes which of the following?

    • A. Karate.repeat.
    • B. Karate-config.js.
    • C. Def.correct
    • D. Url / path.

    Why: def: Defines a variable in a Karate scenario.

  14. 14. "Asserts the response HTTP status code" — in Karate, this describes which of the following?

    • A. Status 200.correct
    • B. Def.
    • C. Gatling integration.
    • D. Url / path.

    Why: status 200: Asserts the response HTTP status code.

  15. 15. "Fuzzy matcher validating a UUID-formatted value" — in Karate, this describes which of the following?

    • A. Karate.repeat.
    • B. Karate-config.js.
    • C. Status 200.
    • D. #uuid.correct

    Why: #uuid: Fuzzy matcher validating a UUID-formatted value.

  16. 16. In Karate, which of the following is described as: "Steps run before each scenario in a Karate feature"?

    • A. Karate-config.js.
    • B. Def.
    • C. #uuid.
    • D. Background:.correct

    Why: Background:: Steps run before each scenario in a Karate feature.

  17. 17. In Karate, which of the following is described as: "Global configuration returning environment variables"?

    • A. Karate-config.js.correct
    • B. #uuid.
    • C. Url / path.
    • D. Karate.repeat.

    Why: karate-config.js: Global configuration returning environment variables.

  18. 18. In Karate, which of the following is described as: "Utility generating arrays for data-driven loops"?

    • A. Karate.repeat.correct
    • B. Background:.
    • C. #uuid.
    • D. Url / path.

    Why: karate.repeat: Utility generating arrays for data-driven loops.

  19. 19. In Karate, which of the following is described as: "Reusing Karate tests as performance tests via Karate-Gatling"?

    • A. Gatling integration.correct
    • B. Def.
    • C. #uuid.
    • D. Karate.repeat.

    Why: gatling integration: Reusing Karate tests as performance tests via Karate-Gatling.

  20. 20. Which Karate concept matches this description: "Steps run before each scenario in a Karate feature"?

    • A. Url / path.
    • B. Karate.repeat.
    • C. Gatling integration.
    • D. Background:.correct

    Why: Background:: Steps run before each scenario in a Karate feature.

Related API Testing topics