Networking and HTTP
HTTP, caching, CDNs, REST, GraphQL and real-time connections.
19 lessons 48 practice questions about 2 hours of reading
Chapter 1, beginner
Foundations
What it is and how it works, the questions every round starts with.
- 01Forward proxy vs reverse proxy: what is the difference?
Lesson, 4 min read, then 5 questions to practise
- Diagnose a failing CORS preflight and write the server's CORS handler
- Design a web API client like Postman: requests, environments, collections and proxying
- Choose Cache-Control headers for hashed assets, HTML and API responses
- Design one build promoted across environments: runtime config, secrets, previews and rollback
- Write a fetch wrapper that sends the CSRF token only where it belongs: unsafe same-origin requests, a cookie or <meta> token, and one refresh on 403
- 02How does DNS resolution work?
Lesson, 5 min read, then 3 questions to practise
- 03Latency vs bandwidth vs throughput: what is the difference?
Lesson, 5 min read, then 3 questions to practise
- Decide which HTTP/1 optimizations still help under HTTP/2 and HTTP/3, and model head-of-line blocking
- Show download progress for a very large file with ReadableStream: totals, throttling and abort
- Decide whether a cache may reuse a response: parse Cache-Control, compute age from Date and Age, and apply s-maxage, private and stale-while-revalidate
- 04TCP vs UDP: what is the difference?
Lesson, 4 min read, then 3 questions to practise
- 05What are the HTTP request methods and when should you use each?
Lesson, 5 min read, then 4 questions to practise
- Save with optimistic concurrency: versioned updates, 409 and 412 conflicts, and a three-way JSON merge
- Build a fault-tolerant React checkout flow with idempotent submission, recovery, and persistent state
- Implement request and response interceptors similar to Axios
- Implement retry with exponential backoff and jitter
- 06What are the parts of a URL? Scheme, host, path, query and fragment
Lesson, 4 min read, then 4 questions to practise
- 07What do the common HTTP status codes mean?
Lesson, 5 min read, then 3 questions to practise
- Handle every data-fetching state: loading, error with retry, empty results, no stale data and abort
- Implement an HTTP cache with ETag validation, stale-while-revalidate, and request deduplication
- Implement a single-flight token refresh mechanism: 10 failed requests trigger only one refresh, followed by safe retries
- 08What does an HTTP request and response look like?
Lesson, 4 min read, then 2 questions to practise
- 09What is Base64 encoding and when should you use it?
Lesson, 10 min read, then 4 questions to practise
- Decode a source map: Base64 VLQ, relative segment fields and originalPositionFor with binary search
- Compress an image in the browser before upload: fit a maximum size, then step down the quality
- Create and revoke upload preview URLs with useObjectUrl
- Assemble streamed binary chunks without quadratic copying
Chapter 2, intermediate
In depth
How it behaves under the hood, and the follow-ups that come next.
- 10Cache-Control: no-cache vs no-store vs max-age=0
Lesson, 5 min read, then 2 questions to practise
- 11Cursor vs offset pagination: which should a frontend use for infinite scroll?
Lesson, 7 min read, then 6 questions to practise
- Build useCursorPagination(): load pages by cursor, drop duplicates, reset when the query changes and ignore stale responses
- Build a TanStack Query-style useInfiniteQuery(): page params, fetchNextPage, hasNextPage, maxPages and refetch
- Build infinite scrolling using IntersectionObserver
- Implement server-side pagination with sorting and filtering
- Design a news feed with infinite scroll
- Design the X (Twitter) home timeline: For You and Following tabs, a new-posts pill, infinite scroll and optimistic likes
- 12How does HTTP caching work? Freshness, validation and 304 responses
Lesson, 5 min read
- 13How does HTTP compression work? gzip vs Brotli vs Zstandard
Lesson, 4 min read
- 14How does HTTPS work? The TLS handshake explained
Lesson, 5 min read
- 15How should a frontend retry failed HTTP requests?
Lesson, 5 min read, then 3 questions to practise
- 16What are HTTP range requests and 206 Partial Content?
Lesson, 4 min read, then 2 questions to practise
- 17What does the Connection: keep-alive header do?
Lesson, 5 min read
- 18What happens in the TCP three-way handshake?
Lesson, 5 min read
- 19What is an idempotency key and why should a frontend send one?
Lesson, 7 min read, then 4 questions to practise
- Build a LoadingButton that keeps its width, blocks double submits and stays accessible
- Design an internet banking web app: fund transfers with OTP, idempotency, session timeouts, security headers and accessibility
- Design UPI payments on the web like PhonePe or Paytm: intent, collect and QR flows, status polling, retries and double-payment safety
- Design Amazon/Flipkart checkout: pricing, cart synchronization, payments, and failure recovery