---
title: "Network protocols and proxies"
url: "https://georgeliinternships.com/interview-prep/network-protocols-proxies-system-design-interview.md"
canonical_url: "https://georgeliinternships.com/interview-prep/network-protocols-proxies-system-design-interview"
last_updated: "2026-11-25"
type: "guide"
summary: "The network basics a design answer rests on: layers, IP, TCP, UDP and HTTP, forward and reverse proxies, status code classes and four checked problems."
related: ["https://georgeliinternships.com/interview-prep.md", "https://georgeliinternships.com/methodology.md", "https://georgeliinternships.com/roles.md"]
---

# Network protocols and proxies: what a design answer needs

> **For AI agents:** the complete index of George Li Internships pages is [llms.txt](https://georgeliinternships.com/llms.txt). Every page is also served as markdown at its URL plus .md.

The network basics a design answer rests on: layers, IP, TCP, UDP and HTTP, forward and reverse proxies, status code classes and four checked problems.

Every design rests on a few network ideas: data travels in layers, IP moves packets between networks, TCP makes delivery reliable and ordered, UDP trades that for speed, and HTTP is how clients ask servers for things. A proxy is a machine placed in the middle of that traffic to filter, cache, hide or balance it. This page defines each piece, shows where it sits and ends with four checked problems.

## Why layers

Two computers that have never met can exchange data because the work is split into layers, each one relying on what the layer beneath provides and ignoring how it is provided. The top layer deals with what the data means; the bottom with wires and radio. Two models are in common use. The internet protocol suite has four layers: link, internet, transport and application. The OSI model has seven, which makes it handy for talking about where a device operates; a layer 7 load balancer, for example, looks at application data. You rarely need to recite either model. You need to know which protocol does which job.

| Layer (internet suite) | Job | Example |
| --- | --- | --- |
| Link | Move frames between machines on the same local network | Ethernet, hardware addresses |
| Internet | Move packets between networks, using addresses | IP |
| Transport | Carry data between two programs, with or without delivery promises | TCP, UDP |
| Application | Give the data meaning for a program | HTTP, and HTTPS, which is HTTP carried inside an encrypted connection |
*Where the common protocols sit*

## IP, TCP and UDP

IP gives every machine an address and breaks data into packets, each with a header that names its source and destination, so that routers can pass the packet along. IP alone does not promise that a packet arrives, arrives once or arrives in order.

TCP, defined in [RFC 9293](https://www.rfc-editor.org/rfc/rfc9293.html), adds those promises. It starts with a three-way handshake to set up a connection, and then delivers the bytes complete, in sequence and with damage detected. The cost is time: a new connection must complete its setup before the first byte of your request can be sent, and encryption on top adds its own setup. UDP skips the connection and those promises. It suits traffic where a late message is worse than a lost one, such as live audio, and cases where one message goes to many recipients. Many other protocols are built on TCP, including encrypted connections and WebSockets, which the [polling and WebSockets guide](https://georgeliinternships.com/interview-prep/polling-sse-websockets-system-design-interview.md) covers.

The practical lesson is the one Problem 1 measures: setup costs round trips, so a design that reuses connections is faster than one that opens a new connection for each request.

## HTTP in a few lines

HTTP is a request and a response. The client sends a method, an address and headers, and sometimes a body; the server answers with a status code, headers and usually a body, often in a format such as JSON. The methods to know are GET to read, POST to create, PUT to create or replace at a given address, DELETE to remove and OPTIONS to ask what a server supports. Sessions can be kept on the server or in a cookie on the client, and several kinds of authentication ride on top.

Status codes are grouped by their first digit, and [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html) defines five classes. Say the class first, then the code: that is almost always enough in a design answer.

| First digit | Class | Examples |
| --- | --- | --- |
| 1 | Informational: the request was received, processing continues | 101 |
| 2 | Successful: the request was received, understood and accepted | 200, 204 |
| 3 | Redirection: further action is needed to complete the request | 301, 302 |
| 4 | Client error: the request has bad syntax or cannot be fulfilled | 401, 404, 429 |
| 5 | Server error: the server failed to fulfill an apparently valid request | 500, 503 |
*Status code classes*

## Proxies

A proxy is a machine placed in the path of a connection that acts on the traffic passing through it. There are two directions, and mixing them up is a common slip.

|  | Forward proxy | Reverse proxy |
| --- | --- | --- |
| Sits in front of | A group of clients | A group of servers |
| Acts on behalf of | The clients, toward the internet | The servers, toward clients |
| Typical uses | Block unwanted sites, enforce a network’s rules, hide the clients’ addresses | Hide the servers, end encrypted connections, balance load, cache answers, filter requests, absorb attacks |
| Example | A school network that blocks certain sites | A public API that refuses every method except GET before the request reaches the application |
*Forward and reverse proxies*

RFC 9110 defines a proxy as a message-forwarding agent chosen by the client, and a gateway, also called a reverse proxy, as an intermediary that acts as an origin server toward the client but forwards requests inward to other servers. Many of the building blocks in a design are really a reverse proxy wearing another name: a [load balancer](https://georgeliinternships.com/interview-prep/load-balancing-system-design-interview.md) is one, and so is a content cache in front of an origin. Problem 3 shows what a shared cache does to the origin’s load.

## How to use this in an answer

- When a client reaches your service, say which protocol it uses and why: HTTP for ordinary requests, a persistent connection for live data.
- When you draw a box between users and servers, say whether it is a reverse proxy and what it does: balance, cache, end encryption or filter.
- When you list failure responses, give the class: a 429 or a 503 tells a client to slow down or retry, and a 400 tells it that retrying the same request is pointless.
- When latency matters, count round trips: connection setup, encryption setup, then the request itself.

A note on who needs this. Our [system design for interns guide](https://georgeliinternships.com/interview-prep/system-design-for-interns.md) found no system design round named in our program records, and a first internship interview is mostly coding, your projects and behavioral questions. This page is for students who are curious, who have a design question in a course or a project, or who are looking ahead to a new-graduate loop. If a recruiter says there will be a design round, ask what scale it expects and prepare for that.

## Practice problems

These problems are our own, written for this site. Every answer is recomputed when the site is built, and a wrong answer would stop the build. Try each before you open the steps. Read [how the problems are checked](https://georgeliinternships.com/methodology.md).

**Problem 1.** A round trip to a server takes 60 milliseconds. A new connection needs 2 round trips of setup before the first request can be sent, and each request then needs 1 round trip. A client sends 5 requests one after another, and the 4 later ones reuse the connection the first one opened. How long do the 5 requests take in all, in milliseconds? Give an integer.

**Answer:** 420

1. Setup costs 2 x 60 = 120 ms, paid once.
2. Each of the 5 requests costs 60 ms, so 5 x 60 = 300 ms.
3. The total is 120 + 300 = 420 ms. Opening a new connection for each request would cost 5 x 180 = 900 ms.

**Problem 2.** Ten responses came back with the status codes 200, 301, 404, 500, 429, 204, 503, 302, 401 and 101. How many of them are client errors or server errors? Give an integer.

**Answer:** 5

1. The first digit gives the class: 1 informational, 2 successful, 3 redirection, 4 client error and 5 server error.
2. The client errors are 404, 429 and 401, and the server errors are 500 and 503.
3. That is 3 + 2 = 5. The codes 200 and 204 are successful, 301 and 302 are redirections and 101 is informational.

**Problem 3.** A reverse proxy with a cache sits in front of an origin server. In one minute, 50 different pages are each requested 40 times, so 2,000 requests arrive. The cache keeps every page it fetches for the whole minute. How many requests reach the origin server? Give an integer.

**Answer:** 50

1. The first request for a page misses the cache and goes to the origin, which then stores the page.
2. The other 39 requests for the same page are answered from the cache.
3. With 50 pages, the origin sees 50 requests instead of 2,000, a drop of 97.5 percent.

## Questions

### What is the difference between TCP and UDP?

TCP sets up a connection and makes sure the data arrives complete, in sequence and uncorrupted. UDP sends messages with no such promises, which suits cases such as broadcasting where speed matters more than every message arriving.

### What is the difference between a forward proxy and a reverse proxy?

A forward proxy sits in front of clients and acts for them toward the internet. A reverse proxy, which RFC 9110 calls a gateway, sits in front of servers and acts for them toward clients.

### What do the first digits of an HTTP status code mean?

RFC 9110 gives five classes by first digit: 1xx informational, 2xx successful, 3xx redirection, 4xx client error and 5xx server error.

## How a session helps

In a session George can work a small design question with you aloud, ask where each of your numbers came from and mark where a protocol choice was left unsaid. You say each design in your own words; nothing here is written for you to recite. See the [packages page](https://georgeliinternships.com/packages.md) for the sessions and [book a session](https://georgeliinternships.com/book.md) when you have a date to work toward.

## Related

- [Internship interview prep](https://georgeliinternships.com/interview-prep.md)
- [Methodology and sources](https://georgeliinternships.com/methodology.md)
- [Internship role guides](https://georgeliinternships.com/roles.md)
