← Bytedance Interview Insights
Knew this one cold so I rattled off connection-oriented vs connectionless, reliability guarantees, ordering, handshake overhead.
Start by defining TCP and UDP at a high level, emphasizing their core design philosophies: TCP as a reliable, connection-oriented protocol and UDP as a lightweight, connectionless protocol. Then systematically compare them across key dimensions like reliability, ordering, speed, and use cases, and conclude by relating them to real-world backend scenarios such as choosing between them for microservices, streaming, or gaming.
Pro tip: Demonstrate maturity by discussing trade-offs in context: for example, explain why UDP is often preferred for real-time applications despite its lack of reliability, and how protocols like QUIC (HTTP/3) build reliability on top of UDP. This shows you understand that the choice depends on requirements, not just textbook differences.
Briefly explain that TCP is a connection-oriented, reliable transport protocol, while UDP is a connectionless, best-effort protocol. Mention that both operate at the transport layer of the OSI model.
Walk through differences in connection setup (handshake vs. no handshake), reliability (acknowledgments, retransmissions vs. no guarantees), ordering (sequenced vs. unordered), and flow/congestion control (TCP has it, UDP does not).
Highlight that TCP's reliability mechanisms introduce latency and overhead, making it slower but suitable for file transfers and web traffic. UDP is faster and more efficient for real-time applications like video streaming, VoIP, and gaming.
Give examples of when to choose each: TCP for HTTP/HTTPS, database connections, and microservice communication; UDP for DNS, streaming media, and real-time multiplayer games. Mention that some systems use both (e.g., HTTP/3 uses QUIC over UDP).
Conclude that the choice depends on requirements: reliability and order vs. speed and low latency. Emphasize that understanding these trade-offs is crucial for designing robust backend systems.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.