Networking Rapid Fire: TCP vs UDP, DNS, Ingress/Egress, Secure Links and API Gateways
Company: Mercor
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
A 20-minute call that turned out to be a rapid-fire fundamentals quiz asked the questions below, one after another. Answer each in a minute or two, precisely, and be ready for a follow-up that goes one level deeper.
### Clarifying Questions
- For ingress and egress, does the interviewer mean traffic direction in general networking, the Kubernetes Ingress resource, or cloud data-transfer charges?
- For securing communication between machines, are the machines in one private network, in different data centers, or talking over the public internet?
- How deep should the URL walkthrough go: browser and DNS only, or down to the connection handshakes and the server side?
### Part 1: TCP versus UDP
What is the difference between TCP and UDP, and when would you choose each?
```hint Swap them and see what breaks
Pick one application that clearly needs each protocol and explain what would go wrong if it used the other one.
```
#### What This Part Should Cover
- Connection setup, delivery and ordering guarantees, and message boundaries
- Flow and congestion control, and what they cost in latency
- Typical uses of each, including protocols built on UDP that add their own reliability
### Part 2: From a typed URL to the right content
Explain how a DNS lookup works and what happens when you type a website's URL into a browser. How does the system make sure that the URL brings back the content you wanted, and what is the mechanism behind it?
```hint Name first, then request
Split the journey into turning the name into an address and then asking that address for one specific resource, and ask which parts of the URL each step uses.
```
#### What This Part Should Cover
- The resolution chain, caching and time-to-live
- Connection setup and how the client verifies that it reached the genuine site
- How the server picks the right content for the host and path, including when many sites share one address
### Part 3: Ingress and egress
Explain ingress and egress.
```hint Pick a boundary
Define both relative to one boundary, such as a cluster or a private network, then name where each direction is controlled and why the controls differ.
```
#### What This Part Should Cover
- The definitions relative to a boundary
- Where each direction is enforced or routed in a typical cloud or Kubernetes deployment
- Why outbound traffic deserves control too, for security and for cost
### Part 4: Securing communication between machines
How do you make sure that communication between machines is secure?
```hint Threats before tools
List what an attacker on the network could do to traffic between two services, then match each threat with a control.
```
#### What This Part Should Cover
- Encryption and integrity in transit
- Authenticating both ends and authorizing which service may call which
- Network isolation, and the management of secrets and certificates
### Part 5: API gateway
Explain what an API gateway is.
```hint What every service would repeat
Picture many clients calling many back-end services, and list the work each service would otherwise have to do on its own.
```
#### What This Part Should Cover
- Its role as a single entry point and the cross-cutting concerns it handles
- How it differs from a load balancer and from a service mesh
- Its costs, such as an extra hop and a possible single point of failure, and how to mitigate them
### What a Strong Answer Covers
- Correct, precise definitions delivered quickly
- Each concept tied to a concrete use or failure
- The parts connected into one request path, from name lookup through the gateway to the services behind it
- Trade-offs named, not just features listed
### Follow-up Questions
- HTTP/3 runs over UDP. Why, and what does it rebuild that TCP used to provide?
- You changed a DNS record, yet some users still reach the old server hours later. Why, and how would you plan the next change?
- How would you rotate the certificates used between services without downtime?
- Your API gateway has become a bottleneck. What do you look at first?
Overview: Rapid-fire networking fundamentals: the difference between TCP and UDP, how DNS and a typed URL lead to the right web content, what ingress and egress mean, how to secure traffic between machines, and what an API gateway does. It tests precise definitions and how the pieces of a request path fit together.