WebSocket & Async APIs interview questions — Medium

149 medium-level WebSocket & Async APIs questions from our API Testing bank, each with the correct answer and an explanation of why it is correct.

What this covers

WebSocket & Async APIs 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.

Other levels:Hard (75)Easy (74)

20 example questions

  1. 1. "Destination for messages that repeatedly fail processing" — in WebSocket, this describes which of the following?

    • A. 101 Switching Protocols.
    • B. Wss://.
    • C. Ping/pong frames.
    • D. Dead letter queue.correct

    Why: dead letter queue: Destination for messages that repeatedly fail processing.

  2. 2. "Definition of an event's structure used for validation" — in WebSocket, this describes which of the following?

    • A. 101 Switching Protocols.
    • B. Kafka topic.
    • C. Event schema.correct
    • D. Dead letter queue.

    Why: event schema: Definition of an event's structure used for validation.

  3. 3. "HTTP status completing a WebSocket upgrade" — in WebSocket, this describes which of the following?

    • A. Event schema.
    • B. Ping/pong frames.
    • C. Backpressure.
    • D. 101 Switching Protocols.correct

    Why: 101 Switching Protocols: HTTP status completing a WebSocket upgrade.

  4. 4. "Keep-alive mechanism verifying the connection is live" — in WebSocket, this describes which of the following?

    • A. Wss://.
    • B. 101 Switching Protocols.
    • C. Kafka topic.
    • D. Ping/pong frames.correct

    Why: ping/pong frames: Keep-alive mechanism verifying the connection is live.

  5. 5. "Mechanism handling consumers slower than producers" — in WebSocket, this describes which of the following?

    • A. 101 Switching Protocols.
    • B. Ping/pong frames.
    • C. Backpressure.correct
    • D. Kafka topic.

    Why: backpressure: Mechanism handling consumers slower than producers.

  6. 6. Which statement correctly describes WebSocket?

    • A. The WebSocket handshake uses FTP rather than HTTP.
    • B. Server-Sent Events allow the client to stream data to the server.
    • C. AsyncAPI is a load-testing tool, not a specification.
    • D. A WebSocket connection starts as an HTTP request upgraded via the Upgrade header.correct

    Why: The 101 Switching Protocols response completes the handshake.

  7. 7. Identify the accurate statement about WebSocket:

    • A. AsyncAPI is a load-testing tool, not a specification.
    • B. Message-driven systems are often tested by publishing to and consuming from queues or topics.correct
    • C. Message queues can only be tested with a web browser.
    • D. WebSocket connections close automatically after every single message.

    Why: Async API testing asserts on events, not synchronous responses.

  8. 8. "Named stream of events consumed by subscribers" — in WebSocket, this describes which of the following?

    • A. Ping/pong frames.
    • B. Backpressure.
    • C. Event schema.
    • D. Kafka topic.correct

    Why: Kafka topic: Named stream of events consumed by subscribers.

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

    • A. Server-Sent Events (SSE) stream data one-way from server to client.correct
    • B. Message queues can only be tested with a web browser.
    • C. WebSockets allow only the client to send messages, never the server.
    • D. Server-Sent Events allow the client to stream data to the server.

    Why: SSE is simpler than WebSocket when only server push is needed.

  10. 10. "TLS-secured WebSocket scheme" — in WebSocket, this describes which of the following?

    • A. Dead letter queue.
    • B. Wss://.correct
    • C. Event schema.
    • D. Kafka topic.

    Why: wss://: TLS-secured WebSocket scheme.

  11. 11. In WebSocket, which of the following is described as: "Definition of an event's structure used for validation"?

    • A. Kafka topic.
    • B. Event schema.correct
    • C. Dead letter queue.
    • D. Wss://.

    Why: event schema: Definition of an event's structure used for validation.

  12. 12. In WebSocket, which of the following is described as: "Keep-alive mechanism verifying the connection is live"?

    • A. Ping/pong frames.correct
    • B. Dead letter queue.
    • C. Backpressure.
    • D. Kafka topic.

    Why: ping/pong frames: Keep-alive mechanism verifying the connection is live.

  13. 13. Which WebSocket concept matches this description: "Definition of an event's structure used for validation"?

    • A. Event schema.correct
    • B. Dead letter queue.
    • C. 101 Switching Protocols.
    • D. Ping/pong frames.

    Why: event schema: Definition of an event's structure used for validation.

  14. 14. In the context of WebSocket, which of the following is a correct statement?

    • A. A WebSocket connection starts as an HTTP request upgraded via the Upgrade header.correct
    • B. Message queues can only be tested with a web browser.
    • C. WebSocket connections close automatically after every single message.
    • D. WebSockets allow only the client to send messages, never the server.

    Why: The 101 Switching Protocols response completes the handshake.

  15. 15. Which WebSocket concept matches this description: "Destination for messages that repeatedly fail processing"?

    • A. Ping/pong frames.
    • B. Dead letter queue.correct
    • C. Backpressure.
    • D. Kafka topic.

    Why: dead letter queue: Destination for messages that repeatedly fail processing.

  16. 16. In WebSocket, which of the following is described as: "Destination for messages that repeatedly fail processing"?

    • A. Backpressure.
    • B. Ping/pong frames.
    • C. Kafka topic.
    • D. Dead letter queue.correct

    Why: dead letter queue: Destination for messages that repeatedly fail processing.

  17. 17. Which WebSocket concept matches this description: "Mechanism handling consumers slower than producers"?

    • A. Kafka topic.
    • B. Dead letter queue.
    • C. Backpressure.correct
    • D. 101 Switching Protocols.

    Why: backpressure: Mechanism handling consumers slower than producers.

  18. 18. Which WebSocket concept matches this description: "HTTP status completing a WebSocket upgrade"?

    • A. Wss://.
    • B. Backpressure.
    • C. 101 Switching Protocols.correct
    • D. Event schema.

    Why: 101 Switching Protocols: HTTP status completing a WebSocket upgrade.

  19. 19. In WebSocket, which of the following is described as: "Mechanism handling consumers slower than producers"?

    • A. Event schema.
    • B. Ping/pong frames.
    • C. Kafka topic.
    • D. Backpressure.correct

    Why: backpressure: Mechanism handling consumers slower than producers.

  20. 20. In WebSocket, which of the following is described as: "HTTP status completing a WebSocket upgrade"?

    • A. 101 Switching Protocols.correct
    • B. Ping/pong frames.
    • C. Dead letter queue.
    • D. Wss://.

    Why: 101 Switching Protocols: HTTP status completing a WebSocket upgrade.

Related API Testing topics