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.
20 example questions
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. "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.
3. "HTTP status completing a WebSocket upgrade" — in WebSocket, this describes which of the following?
- A. Event schema.
- B. Dead letter queue.
- C. 101 Switching Protocols.correct
- D. Backpressure.
Why: 101 Switching Protocols: HTTP status completing a WebSocket upgrade.
4. "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.
5. Which of the following statements about WebSocket is TRUE?
- 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. AsyncAPI is a load-testing tool, not a specification.
- D. WebSocket connections close automatically after every single message.
Why: The 101 Switching Protocols response completes the handshake.
6. Which statement correctly describes WebSocket?
- A. Message queues can only be tested with a web browser.
- B. A WebSocket connection starts as an HTTP request upgraded via the Upgrade header.correct
- C. WebSocket connections close automatically after every single message.
- D. The WebSocket handshake uses FTP rather than HTTP.
Why: The 101 Switching Protocols response completes the handshake.
7. Identify the accurate statement about WebSocket:
- A. Server-Sent Events allow the client to stream data to the server.
- B. WebSocket connections close automatically after every single message.
- C. Testing WebSockets involves validating connection lifecycle, message order, and reconnection behavior.correct
- D. The WebSocket handshake uses FTP rather than HTTP.
Why: Async channels need lifecycle and resilience checks beyond payloads.
8. "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.
9. "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.
10. 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.
11. Which WebSocket concept matches this description: "Definition of an event's structure used for validation"?
- A. Event schema.correct
- B. 101 Switching Protocols.
- C. Backpressure.
- D. Ping/pong frames.
Why: event schema: Definition of an event's structure used for validation.
12. In the context of WebSocket, which of the following is a correct statement?
- A. Message queues can only be tested with a web browser.
- B. A WebSocket connection starts as an HTTP request upgraded via the Upgrade header.correct
- C. Server-Sent Events allow the client to stream data to the server.
- D. The WebSocket handshake uses FTP rather than HTTP.
Why: The 101 Switching Protocols response completes the handshake.
13. Which WebSocket concept matches this description: "HTTP status completing a WebSocket upgrade"?
- A. Dead letter queue.
- B. Event schema.
- C. Ping/pong frames.
- D. 101 Switching Protocols.correct
Why: 101 Switching Protocols: HTTP status completing a WebSocket upgrade.
14. 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.
15. 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.
16. Which WebSocket concept matches this description: "Keep-alive mechanism verifying the connection is live"?
- A. Ping/pong frames.correct
- B. Wss://.
- C. Backpressure.
- D. Event schema.
Why: ping/pong frames: Keep-alive mechanism verifying the connection is live.
17. Which WebSocket concept matches this description: "Destination for messages that repeatedly fail processing"?
- A. Wss://.
- B. 101 Switching Protocols.
- C. Ping/pong frames.
- D. Dead letter queue.correct
Why: dead letter queue: Destination for messages that repeatedly fail processing.
18. 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.
19. In WebSocket, which of the following is described as: "Mechanism handling consumers slower than producers"?
- A. Ping/pong frames.
- B. Kafka topic.
- C. Backpressure.correct
- D. Wss://.
Why: backpressure: Mechanism handling consumers slower than producers.
20. Which WebSocket concept matches this description: "Named stream of events consumed by subscribers"?
- A. Kafka topic.correct
- B. Ping/pong frames.
- C. Wss://.
- D. 101 Switching Protocols.
Why: Kafka topic: Named stream of events consumed by subscribers.