Mocking & Virtualization interview questions — Easy

99 easy-level Mocking & Virtualization questions from our API Testing bank, each with the correct answer and an explanation of why it is correct.

This topic slice is available to practise but is not yet part of our indexed set.

What this covers

Mocking & Virtualization appears throughout API Testing interviews. At easy level, interviewers are typically checking that you know the fundamentals and can describe them precisely — definitions, defaults, and the basic mechanics. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. Which of the following best describes priority matching in Mocking?

    • A. Deliberately returning errors or malformed data to test resilience.
    • B. Forwarding unmatched requests to a real backend.
    • C. Building dynamic mock responses from request data.
    • D. Choosing among overlapping stubs by priority value.correct

    Why: priority matching: Choosing among overlapping stubs by priority value.

  2. 2. Which of the following best describes response templating in Mocking?

    • A. Forwarding unmatched requests to a real backend.
    • B. Provider-hosted fake environment for third-party APIs.
    • C. Building dynamic mock responses from request data.correct
    • D. Choosing among overlapping stubs by priority value.

    Why: response templating: Building dynamic mock responses from request data.

  3. 3. In the context of Mocking, response templating is best described as:

    • A. Building dynamic mock responses from request data.correct
    • B. Choosing among overlapping stubs by priority value.
    • C. Provider-hosted fake environment for third-party APIs.
    • D. WireMock rule matching a request to a canned response.

    Why: response templating: Building dynamic mock responses from request data.

  4. 4. Which of the following best describes chaos testing in Mocking?

    • A. Choosing among overlapping stubs by priority value.
    • B. Injecting failures to validate system resilience.correct
    • C. Provider-hosted fake environment for third-party APIs.
    • D. Building dynamic mock responses from request data.

    Why: chaos testing: Injecting failures to validate system resilience.

  5. 5. Which of the following best describes stub mapping in Mocking?

    • A. Injecting failures to validate system resilience.
    • B. WireMock rule matching a request to a canned response.correct
    • C. Building dynamic mock responses from request data.
    • D. Choosing among overlapping stubs by priority value.

    Why: stub mapping: WireMock rule matching a request to a canned response.

  6. 6. Which of the following best describes fault injection in Mocking?

    • A. WireMock rule matching a request to a canned response.
    • B. Building dynamic mock responses from request data.
    • C. Deliberately returning errors or malformed data to test resilience.correct
    • D. Choosing among overlapping stubs by priority value.

    Why: fault injection: Deliberately returning errors or malformed data to test resilience.

  7. 7. In Mocking, what does response templating do or refer to?

    • A. Deliberately returning errors or malformed data to test resilience.
    • B. WireMock rule matching a request to a canned response.
    • C. Provider-hosted fake environment for third-party APIs.
    • D. Building dynamic mock responses from request data.correct

    Why: response templating: Building dynamic mock responses from request data.

  8. 8. In Mocking, what does chaos testing do or refer to?

    • A. Injecting failures to validate system resilience.correct
    • B. Forwarding unmatched requests to a real backend.
    • C. Provider-hosted fake environment for third-party APIs.
    • D. WireMock rule matching a request to a canned response.

    Why: chaos testing: Injecting failures to validate system resilience.

  9. 9. What is the purpose of response templating in Mocking?

    • A. Injecting failures to validate system resilience.
    • B. Building dynamic mock responses from request data.correct
    • C. Deliberately returning errors or malformed data to test resilience.
    • D. Forwarding unmatched requests to a real backend.

    Why: response templating: Building dynamic mock responses from request data.

  10. 10. In Mocking, what does fault injection do or refer to?

    • A. Deliberately returning errors or malformed data to test resilience.correct
    • B. Provider-hosted fake environment for third-party APIs.
    • C. Building dynamic mock responses from request data.
    • D. Forwarding unmatched requests to a real backend.

    Why: fault injection: Deliberately returning errors or malformed data to test resilience.

  11. 11. What is the purpose of sandbox environment in Mocking?

    • A. Choosing among overlapping stubs by priority value.
    • B. Building dynamic mock responses from request data.
    • C. Injecting failures to validate system resilience.
    • D. Provider-hosted fake environment for third-party APIs.correct

    Why: sandbox environment: Provider-hosted fake environment for third-party APIs.

  12. 12. What is the purpose of chaos testing in Mocking?

    • A. Provider-hosted fake environment for third-party APIs.
    • B. Injecting failures to validate system resilience.correct
    • C. Forwarding unmatched requests to a real backend.
    • D. Building dynamic mock responses from request data.

    Why: chaos testing: Injecting failures to validate system resilience.

  13. 13. What is the purpose of priority matching in Mocking?

    • A. Building dynamic mock responses from request data.
    • B. Provider-hosted fake environment for third-party APIs.
    • C. Choosing among overlapping stubs by priority value.correct
    • D. Forwarding unmatched requests to a real backend.

    Why: priority matching: Choosing among overlapping stubs by priority value.

  14. 14. What is the purpose of stub mapping in Mocking?

    • A. WireMock rule matching a request to a canned response.correct
    • B. Choosing among overlapping stubs by priority value.
    • C. Provider-hosted fake environment for third-party APIs.
    • D. Injecting failures to validate system resilience.

    Why: stub mapping: WireMock rule matching a request to a canned response.

  15. 15. In Mocking, what does priority matching do or refer to?

    • A. Provider-hosted fake environment for third-party APIs.
    • B. Injecting failures to validate system resilience.
    • C. Choosing among overlapping stubs by priority value.correct
    • D. Building dynamic mock responses from request data.

    Why: priority matching: Choosing among overlapping stubs by priority value.

  16. 16. What is the purpose of fault injection in Mocking?

    • A. Provider-hosted fake environment for third-party APIs.
    • B. Deliberately returning errors or malformed data to test resilience.correct
    • C. WireMock rule matching a request to a canned response.
    • D. Choosing among overlapping stubs by priority value.

    Why: fault injection: Deliberately returning errors or malformed data to test resilience.

  17. 17. In Mocking, what does stub mapping do or refer to?

    • A. Provider-hosted fake environment for third-party APIs.
    • B. Choosing among overlapping stubs by priority value.
    • C. WireMock rule matching a request to a canned response.correct
    • D. Injecting failures to validate system resilience.

    Why: stub mapping: WireMock rule matching a request to a canned response.

  18. 18. In Mocking, what does sandbox environment do or refer to?

    • A. Provider-hosted fake environment for third-party APIs.correct
    • B. Deliberately returning errors or malformed data to test resilience.
    • C. Choosing among overlapping stubs by priority value.
    • D. WireMock rule matching a request to a canned response.

    Why: sandbox environment: Provider-hosted fake environment for third-party APIs.

  19. 19. What is the purpose of proxying in Mocking?

    • A. Building dynamic mock responses from request data.
    • B. Deliberately returning errors or malformed data to test resilience.
    • C. Forwarding unmatched requests to a real backend.correct
    • D. Provider-hosted fake environment for third-party APIs.

    Why: proxying: Forwarding unmatched requests to a real backend.

  20. 20. In Mocking, what does proxying do or refer to?

    • A. Deliberately returning errors or malformed data to test resilience.
    • B. Forwarding unmatched requests to a real backend.correct
    • C. WireMock rule matching a request to a canned response.
    • D. Choosing among overlapping stubs by priority value.

    Why: proxying: Forwarding unmatched requests to a real backend.

Related API Testing topics