Interview Questions/Phone Screen/HTTP Keep-Alive & Connection Pooling
IntermediatePhone
2 min

HTTP Keep-Alive & Connection Pooling

HTTPPerformanceNetworking
Advertisement
Interview Question

What is HTTP keep-alive and why does connection pooling improve performance?

Key Points to Cover
  • Keep-alive reuses TCP connections for multiple requests
  • Reduces handshake/latency and resource usage
  • Pooling limits concurrent sockets and improves throughput
Evaluation Rubric
Defines keep-alive correctly34% weight
Explains latency/overhead reduction33% weight
Describes pooling benefits/limits33% weight
Hints
  • 💡TCP handshakes and TLS handshakes are expensive.
Common Pitfalls to Avoid
  • ⚠️Failing to differentiate HTTP keep-alive as a protocol feature from connection pooling as an application-level management technique.
  • ⚠️Not explicitly mentioning the overhead of the TCP three-way handshake and TLS handshake as the primary benefit of avoiding new connections.
  • ⚠️Overlooking the resource utilization benefits, such as reduced server CPU/memory usage from not constantly creating and destroying sockets.
  • ⚠️Failing to explain *why* limiting concurrent connections in a pool improves performance (e.g., preventing resource exhaustion on the server or client, better resource sharing).
  • ⚠️Not mentioning that HTTP/1.1 makes keep-alive the default behavior unless explicitly disabled, which is important context.
Potential Follow-up Questions
  • How does HTTP/2 change this?
  • What about connection limits per host?
Advertisement