Try
↑ ↓ move↵ openesc close

Interview prep / Connections and head-of-line blocking

Junior · Connections and head-of-line blocking · System design interview question

Why does a new HTTPS connection take time before the first request?

Sketch your own answer first, then compare it with the one below.

A strong answer

TCP needs one round trip to set up the connection. TLS needs more round trips to authenticate the server and agree on keys. With TLS 1.3 it is one, so a new connection needs two round trips before the request can be sent.

At a 50 ms round trip that is 100 ms of setup. This is why clients reuse connections, and why QUIC, which combines the transport and encryption handshakes, needs one round trip.

Sources

Learn it by running it

The connections and head-of-line blocking lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms