# Exercise 1 — Choosing TCP or UDP

## Scenario

You're the tech lead deciding transport protocols for four new features. For each, you must justify the choice with real technical reasoning, not gut feeling.

## Deliverables

For each feature below, choose TCP or UDP, and justify your choice in 3-5 sentences referencing specific TCP/UDP properties (not just "TCP is reliable" — explain which property actually matters here and why the other protocol's tradeoff would hurt):

1. **A multiplayer first-person shooter** sending player position updates 30 times per second.
2. **A file backup service** uploading large files to cloud storage, where every byte must arrive intact.
3. **A DNS resolver** sending a single small query and expecting a single small response, needing to complete as fast as possible.
4. **A live stock ticker** pushing price updates to thousands of connected clients, where an update that's even 200ms stale is worse than a dropped one (a newer update will follow almost immediately).
5. **A REST API** for a banking application handling account transfers.

## Additional deliverable

6. **Handshake cost calculation.** If a TCP handshake takes one full round trip (RTT) before the first byte of real data can be sent, and a given client-server pair has an RTT of 150ms, how much added latency does opening a brand-new TCP connection add to the very first request, before any application data is even exchanged? If the client instead reuses an already-open TCP connection (keep-alive) for a second request, how does that change the answer? Write your reasoning, not just a number.

## Notes

- Do not just restate the theory file's table — apply the specific properties (handshake cost, reliability mechanism, flow/congestion control, header overhead) to each scenario's actual requirements.
