TCP versus UDP: delivery guarantees, overhead and which applications suit each
Company: Tesla
Role: Product Manager
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Other
Compare TCP and UDP. How do the two transport protocols differ in what they guarantee and in how they work?
```hint Start from the promises
Begin with what each protocol promises the application about its data, then explain what each one must do, or skips doing, to keep that promise.
```
### Clarifying Questions
- How deep should I go: the guarantees each protocol offers, or also mechanics such as the handshake and congestion control?
- Would it help to ground the comparison in product examples, such as video calls and file downloads?
- Should I include newer protocols that run on top of UDP, or stay with the two classic ones?
### What a Strong Answer Covers
- Connection setup and the state each protocol keeps
- Delivery guarantees: loss, ordering and duplicates, and what recovers them
- Flow and congestion control, and their effect on latency and throughput
- Message boundaries and header overhead
- The kinds of applications suited to each, with the reasoning behind the fit
### Follow-up Questions
- A video-calling feature stutters and freezes on poor networks. Why might moving its media from TCP to UDP help, and what must the application then handle itself?
- Why do some modern web protocols run on top of UDP rather than TCP?
- What is head-of-line blocking, and when do users feel it?
Overview: A networking fundamentals question asked of product managers: compare the TCP and UDP transport protocols. It tests understanding of connection setup, reliability and ordering, flow and congestion control, header overhead, and which kinds of applications suit each protocol.