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. "Keep-alive mechanism verifying the connection is live" — in WebSocket, this describes which of the following?
- A. Ping/pong frames.correct
- B. Wss://.
- C. Dead letter queue.
- D. 101 Switching Protocols.
Why: ping/pong frames: Keep-alive mechanism verifying the connection is live.
2. "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.
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. "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. Identify the accurate statement about WebSocket:
- A. Server-Sent Events allow the client to stream data to the server.
- B. A WebSocket connection starts as an HTTP request upgraded via the Upgrade header.correct
- C. The WebSocket handshake uses FTP rather than HTTP.
- D. WebSocket connections close automatically after every single message.
Why: The 101 Switching Protocols response completes the handshake.
7. "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.
8. Which statement correctly describes WebSocket?
- A. WebSockets allow only the client to send messages, never the server.
- B. AsyncAPI is a load-testing tool, not a specification.
- C. The WebSocket handshake uses FTP rather than HTTP.
- D. WebSocket provides full-duplex, persistent communication over a single TCP connection.correct
Why: Both sides can push messages at any time after the handshake.
9. "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.
10. 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. Server-Sent Events allow the client to stream data to the server.
- C. WebSockets allow only the client to send messages, never the server.
- D. WebSocket provides full-duplex, persistent communication over a single TCP connection.correct
Why: Both sides can push messages at any time after the handshake.
11. 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.
12. 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.
13. 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.
14. 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.
15. Which WebSocket concept matches this description: "Keep-alive mechanism verifying the connection is live"?
- A. 101 Switching Protocols.
- B. Dead letter queue.
- C. Ping/pong frames.correct
- D. Kafka topic.
Why: ping/pong frames: Keep-alive mechanism verifying the connection is live.
16. Which WebSocket concept matches this description: "Destination for messages that repeatedly fail processing"?
- A. 101 Switching Protocols.
- B. Dead letter queue.correct
- C. Kafka topic.
- D. Event schema.
Why: dead letter queue: Destination for messages that repeatedly fail processing.
17. Which WebSocket concept matches this description: "Mechanism handling consumers slower than producers"?
- A. Backpressure.correct
- B. Ping/pong frames.
- C. Kafka topic.
- D. 101 Switching Protocols.
Why: backpressure: Mechanism handling consumers slower than producers.
18. In WebSocket, which of the following is described as: "Definition of an event's structure used for validation"?
- A. Kafka topic.
- B. Backpressure.
- C. Event schema.correct
- D. Dead letter queue.
Why: event schema: Definition of an event's structure used for validation.
19. 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.
20. In WebSocket, which of the following is described as: "Keep-alive mechanism verifying the connection is live"?
- A. Dead letter queue.
- B. 101 Switching Protocols.
- C. Wss://.
- D. Ping/pong frames.correct
Why: ping/pong frames: Keep-alive mechanism verifying the connection is live.