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. During a code review, a reviewer asks: 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.
2. "Reusing Karate tests as performance tests via Karate-Gatling" — in Karate, this describes which of the following?
- A. Gatling integration.correct
- B. Def.
- C. Karate.repeat.
- D. #uuid.
Why: gatling integration: Reusing Karate tests as performance tests via Karate-Gatling.
3. "Global configuration returning environment variables" — in Karate, this describes which of the following?
- A. Background:.
- B. Url / path.
- C. Karate-config.js.correct
- D. Gatling integration.
Why: karate-config.js: Global configuration returning environment variables.
4. 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').
5. A defining feature of Karate is:
- A. Heavy Java step code.
- B. Gherkin syntax with no glue code needed.correct
- C. No assertions.
- D. SOAP only.
Why: Karate runs Gherkin features directly with built-in HTTP/assert steps.
6. "Fuzzy matcher validating a UUID-formatted value" — in Karate, this describes which of the following?
- A. Karate-config.js.
- B. Gatling integration.
- C. #uuid.correct
- D. Def.
Why: #uuid: Fuzzy matcher validating a UUID-formatted value.
7. "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.
8. "Asserts the response HTTP status code" — in Karate, this describes which of the following?
- A. Karate.repeat.
- B. Karate-config.js.
- C. Def.
- D. Status 200.correct
Why: status 200: Asserts the response HTTP status code.
9. "Keywords composing the request endpoint" — in Karate, this describes which of the following?
- A. Def.
- B. Url / path.correct
- C. Status 200.
- D. Karate-config.js.
Why: url / path: Keywords composing the request endpoint.
10. 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.
11. Which of the following statements about Karate is TRUE?
- A. Karate has no support for data-driven scenarios.
- B. Karate requires writing Java step definitions for every Gherkin step.
- C. Karate cannot mock or simulate API endpoints.
- D. Karate.forEach and karate-config.js provide looping and centralized configuration.correct
Why: karate-config.js sets environment-specific variables globally.
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. Identify the accurate statement about Karate:
- A. Karate cannot mock or simulate API endpoints.
- B. The match keyword can only compare exact string values.
- C. JavaScript cannot be used inside Karate tests.
- D. Karate supports data-driven testing with Scenario Outline and Examples.correct
Why: Outlines iterate scenarios over tabular data.
14. In the context of Karate, which of the following is a correct statement?
- A. Karate feature files cannot call or reuse other feature files.
- B. JavaScript cannot be used inside Karate tests.
- C. The match keyword performs deep equality and schema-style validation of JSON.correct
- D. The match keyword can only compare exact string values.
Why: match response == { id: '#number', name: '#string' } validates types.
15. Which Karate concept matches this description: "Reusing Karate tests as performance tests via Karate-Gatling"?
- A. Status 200.
- B. Gatling integration.correct
- C. Def.
- D. Karate.repeat.
Why: gatling integration: Reusing Karate tests as performance tests via Karate-Gatling.
16. 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.
17. In Karate, which of the following is described as: "Global configuration returning environment variables"?
- A. Url / path.
- B. Karate-config.js.correct
- C. Karate.repeat.
- D. Gatling integration.
Why: karate-config.js: Global configuration returning environment variables.
18. In Karate, which of the following is described as: "Utility generating arrays for data-driven loops"?
- A. Karate-config.js.
- B. Karate.repeat.correct
- C. #uuid.
- D. Url / path.
Why: karate.repeat: Utility generating arrays for data-driven loops.
19. In Karate, which of the following is described as: "Reusing Karate tests as performance tests via Karate-Gatling"?
- A. Background:.
- B. Gatling integration.correct
- C. #uuid.
- D. Karate.repeat.
Why: gatling integration: Reusing Karate tests as performance tests via Karate-Gatling.
20. Which Karate concept matches this description: "Global configuration returning environment variables"?
- A. Gatling integration.
- B. Def.
- C. Karate.repeat.
- D. Karate-config.js.correct
Why: karate-config.js: Global configuration returning environment variables.