Sockets, TCP and UDP — when to use which?
Essence
A socket is a connection endpoint (protocol + address + port). The transport underneath it determines guarantees and latency.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep