Loading...
Loading...
HTTP/3, QUIC, DNS, TLS, CDN, WebSockets, and the protocols SDE-2 interviews expect.
Module 11 · Advanced Networking
HTTP/2 vs HTTP/3, TCP vs UDP vs QUIC, DNS, TLS, connection pooling, load balancing, CDN, WebSockets, SSE, and Service Workers.
Advanced networking for frontend engineers: HTTP methods, caching headers, CDN, CORS, TLS, DNS prefetching, Long-Polling vs WebSockets vs SSE, and the full journey from typing a URL to page load.
Advanced networking goes beyond fetch() — SDE-2 interviews expect you to explain HTTP/2 multiplexing, why HTTP/3 uses QUIC over UDP, the TCP 3-way handshake, DNS resolution flow, and when to pick WebSockets vs SSE.
This module covers protocol comparisons, TLS handshakes, CDN architecture, load balancing strategies, real-time communication patterns, and Service Worker offline caching.
From typing a URL to receiving a response, you will trace DNS resolution, TCP/TLS handshakes, HTTP caching headers, and when to choose WebSockets, SSE, or long-polling for live data.
Deep dives include HTTP methods, Cache-Control and ETag, CDN benefits, CORS preflight, PUT vs PATCH, symmetric vs asymmetric encryption, and the full browser-to-server request lifecycle.
Networking questions appear in SDE-2 frontend and system design loops. You must explain HTTP caching with ETag and Cache-Control, why CDNs improve LCP, CORS preflight behavior, and real-time protocol trade-offs — not just name protocols. Every API call your React app makes depends on this stack.
Secure, intelligent foundations beyond simple connectivity.
Advanced Networking goes beyond simple connectivity — creating a secure, intelligent, agile foundation that adapts to rapidly changing needs.
Multiplexing, QUIC, and the evolution of web protocols.
HTTP/2 (2015)
HTTP/3 (2022)
| Aspect | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| Protocol | TCP | TCP | UDP (QUIC) |
| Multiplexing | No | Yes | Yes |
| Header Compression | No | HPACK | QPACK |
| Connection Setup | 3 RTT | 2 RTT | 0–1 RTT |
| Encryption | Optional | Optional | Mandatory |
| Latency | High | Medium | Lowest |
Reliability vs speed — pick the right transport layer.
| Aspect | TCP | UDP |
|---|---|---|
| Reliability | Reliable — retransmits lost packets | Unreliable — fire-and-forget |
| Ordering | Ordered | Unordered |
| Connection | 3-way handshake | None — send immediately |
| Speed | Slower | Faster |
| Overhead | Higher | Lower |
| Use Case | HTTP, FTP, email | Video streaming, VoIP, gaming |
Domain names to IP addresses — resolution flow and optimization.
DNS converts domain names (google.com) to IP addresses (142.250.80.4).
| Record | Purpose |
|---|---|
| A | Domain → IPv4 |
| AAAA | Domain → IPv6 |
| CNAME | Domain → Domain (alias) |
| MX | Email server |
| TXT | Verification (SPF, DKIM) |
<link rel="dns-prefetch" href="https://api.example.com"> <link rel="dns-prefetch" href="https://cdn.example.com">
Encrypting data in transit — HTTPS handshake.
| Version | Status |
|---|---|
| TLS 1.0 / 1.1 | Deprecated — insecure |
| TLS 1.2 | Current standard |
| TLS 1.3 | Latest — faster, more secure |
Reuse TCP connections — skip the handshake.
import http from "node:http"; const agent = new http.Agent({ maxSockets: 50 }); http.get("https://api.com/data", { agent }, (res) => { // Connection reused from pool });
Distribute traffic across multiple servers.
| Type | Description | Best For |
|---|---|---|
| Round Robin | Sequential 1 → 2 → 3 → 1 | Equal capacity servers |
| Least Connections | Fewest active connections | Variable capacity |
| Weighted | Priority by weight | Different server sizes |
| IP Hash | Same client IP → same server | Session persistence |
Global edge caching for faster loads.
Persistent bidirectional real-time communication.
const ws = new WebSocket("wss://socket.example.com"); ws.onopen = () => console.log("Connected"); ws.onmessage = (e) => console.log(e.data); ws.send("Hello"); ws.close();
One-way server → client streaming over HTTP.
const eventSource = new EventSource("https://api.com/updates"); eventSource.onmessage = (e) => console.log(e.data);
| Aspect | WebSockets | SSE |
|---|---|---|
| Direction | Bidirectional | One-way (server → client) |
| Protocol | WebSocket | HTTP |
| Use Case | Chat, gaming | Feeds, notifications |
Background scripts intercepting network requests.
self.addEventListener("fetch", (event) => { event.respondWith( caches.match(event.request).then((response) => { return response || fetch(event.request); }) ); });
TCP vs UDP vs QUIC, protocols, load balancing, real-time.
TCP vs UDP vs QUIC
| Aspect | TCP | UDP | QUIC |
|---|---|---|---|
| Reliability | Reliable | Unreliable | Reliable |
| Connection | 3-way handshake | None | 0–1 RTT |
| Latency | High | Low | Lowest |
| Use Case | HTTP/1.1, HTTP/2 | Video, gaming | HTTP/3 |
WebSockets vs SSE vs HTTP
| Aspect | WebSockets | SSE | HTTP |
|---|---|---|---|
| Direction | Bidirectional | One-way | One-way |
| Persistent | Yes | Yes | No |
| Latency | Lowest | Low | High |
| Use Case | Chat, gaming | Feeds | Regular requests |
Ten points to nail advanced networking questions.
Common interview questions about advanced networking.