To answer confidently in system design interviews, you need to go beyond basic definitions of HTTP/HTTPS and be able to discuss:
- The evolution of HTTP versions (1.0 to 3.0)
- Key features and differences
- How these versions impact performance, concurrency, and scalability
- Where HTTPS fits in (security layer)
β What is HTTP?
HTTP (HyperText Transfer Protocol) is a stateless, application-layer protocol used for transmitting hypermedia (like HTML) over the web. It follows the client-server model, where the client (e.g., browser) sends a request and the server responds.
π HTTP Versions: 1.0 β 3.0
πΉ HTTP/1.0 (1996)
- Connection model: One TCP connection per request-response pair. After response, connection closes.
- No persistent connections by default.
- No support for request pipelining or multiplexing.
- No host header initially β couldnβt host multiple domains on one IP (fixed via
Host:header extension).
Issues:
- High latency (TCP handshake for every request).
- Inefficient for web pages with multiple resources (images, CSS, JS).
πΉ HTTP/1.1 (1997 - still widely used)
- Persistent connections (
keep-alive) β reuse the same TCP connection for multiple requests/responses. - Pipelining: Allows sending multiple requests without waiting for responses (but no parallelismβmust be answered in order).
- Introduced chunked transfer encoding, cache control headers, and host header (support for virtual hosting).
- Still head-of-line blocking at the application layer (browser waits for response in order of requests).
Impact:
- Better than 1.0 in terms of performance and bandwidth usage.
- Still struggles with concurrent loading of many resources.
πΉ HTTP/2 (2015)
- Binary protocol instead of text β more compact and efficient.
- Supports full multiplexing: multiple concurrent streams over a single TCP connection.
- Header compression using HPACK.
- Server push: Server can proactively send resources before client requests.
- Still uses TCP underneath.
Benefits:
- No head-of-line blocking at HTTP level (but still at TCP level).
- Drastically improved latency and resource loading.
- Widely adopted by major websites and CDNs.
πΉ HTTP/3 (2022 - emerging standard)
- Based on QUIC protocol (by Google), which runs on UDP, not TCP.
- Built-in TLS 1.3 for encryption.
- Supports independent streams β no head-of-line blocking at transport layer.
- Faster connection establishment (0-RTT, 1-RTT).
- Better for mobile networks due to improved recovery and less congestion.
Key Differences:
- Uses UDP instead of TCP.
- Fixes TCP-level head-of-line blocking.
- Improved resilience to packet loss and network changes (e.g., switching from Wi-Fi to 4G).
π HTTPS (HyperText Transfer Protocol Secure)
- Not a separate protocol β itβs HTTP over TLS (SSL).
-
Ensures:
- Encryption (data is secure)
- Authentication (server is who it says it is)
- Integrity (data is not tampered with)
How it works:
- TLS handshake happens before HTTP communication.
- Uses public-key cryptography to exchange symmetric keys.
- Required for security-sensitive applications (e.g., login, payments).
- Mandatory for HTTP/2 and HTTP/3 (they donβt work without TLS).
π‘ Interview-Worthy Comparisons
| Feature | HTTP/1.0 | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|---|
| Connection reuse | β | β | β | β |
| Multiplexing | β | β (pipelining only) | β | β |
| Head-of-line blocking | β | β | β (TCP level) | β |
| Protocol type | Text | Text | Binary | Binary |
| Transport protocol | TCP | TCP | TCP | UDP (via QUIC) |
| TLS required | β | β | β (mostly) | β (always) |
| Server push | β | β | β | β |
| Compression | β | β | β (HPACK) | β (QPACK) |
π How to Talk About This in Interviews
1. Explain Evolution:
βHTTP started with 1.0 as a simple stateless protocol, but performance and scalability were poor. 1.1 improved by keeping connections alive and adding basic pipelining. HTTP/2 overhauled this with binary framing and multiplexing, and HTTP/3 took a bigger leap by moving to QUIC over UDP, eliminating TCPβs head-of-line blocking.β
2. Discuss Impact:
βIn system design, choosing HTTP/2 or HTTP/3 can significantly improve latency and throughput, especially for resource-heavy or mobile-first applications.β
3. Mention HTTPS:
βHTTPS is essential in modern systems for security and privacy. It uses TLS to encrypt HTTP, and itβs mandatory for HTTP/2 and 3.β
π HTTP vs HTTPS
| Feature | HTTP | HTTPS |
|---|---|---|
| Full Form | HyperText Transfer Protocol | HyperText Transfer Protocol Secure |
| Security | β Not secure (data sent in plain text) | β Secure (data is encrypted) |
| Encryption | β No encryption | β Uses TLS/SSL to encrypt data |
| Port Used | 80 | 443 |
| URL Prefix | http:// |
https:// |
| Certificate Required | β Not required | β Requires an SSL/TLS certificate (e.g., from Letβs Encrypt, DigiCert) |
| Data Integrity | β No guarantee | β Ensures data is not altered during transit |
| Authentication | β No server verification | β Verifies server identity via certificate |
| Performance | Slightly faster (no encryption overhead) | Slightly slower initially (due to TLS handshake), but optimized with HTTP/2/3 |
| SEO & Browser Trust | β Marked as βNot Secureβ in browsers | β Preferred by browsers and search engines |
| Use Case | Non-sensitive data or legacy systems | Secure web apps (login, payments, APIs, etc.) |
β Summary for Interview:
βHTTPS is essentially HTTP + encryption. It uses TLS to secure communication, protect against MITM attacks, and ensure integrity. Itβs a must-have for any system handling sensitive data and is mandatory for modern protocols like HTTP/2 and HTTP/3.β