Reviewed by Aditya Kumar · Last reviewed 2026-08-08
TCP (Transmission Control Protocol) is a connection oriented, reliable, and ordered protocol, whereas UDP (User Datagram Protocol) is connectionless, unreliable, and unordered. The choice between them…
This hard-level General/Other question appears frequently in data engineering interviews at companies like ZS Associates. While less common, it tests deeper understanding that distinguishes strong candidates.
This is a senior-level question that tests architectural thinking. Lead with the high-level design, then drill into specifics. Discuss trade-offs explicitly - there is rarely one correct answer. Show awareness of scale, fault tolerance, and operational complexity.
TCP (Transmission Control Protocol) is a connection-oriented, reliable, and ordered protocol, whereas UDP (User Datagram Protocol) is connectionless, unreliable, and unordered. The choice between them hinges on the application's priority for data integrity versus speed and low overhead.
UDP, in contrast, sends independent packets (datagrams) without establishing a connection or waiting for acknowledgments. It offers no guarantees regarding delivery, order, or duplication. This simplicity results in very low latency and minimal overhead, making it faster but inherently less reliable.
UDP is employed in specific scenarios where speed and low overhead outweigh the need for guaranteed delivery:
* Metrics collection: Systems like StatsD or Prometheus UDP exporters use UDP to send ephemeral metrics (e.g., counter increments, timings). Losing an occasional metric point is acceptable for the benefit of not blocking the application or adding significant network overhead.
* DNS: Domain Name System queries often use UDP for quick lookups, falling back to TCP for larger responses.
* Real-time streaming: Live video or audio streaming can tolerate minor packet loss for continuous, low-latency playback.
The core trade-off is reliability and data integrity (TCP) versus speed and low latency (UDP). Data pipelines generally prioritize the former to ensure data quality and consistency, making TCP the default for most data transport.
In the interview, also mention how this choice impacts system design, error handling strategies, and the overall performance characteristics of different components within a data pipeline.
Red Flag: 'UDP is always bad.' Pro-Move: 'Kafka/TCP for data; we use UDP for high-volume metrics—accept 0.1% loss for 10x throughput.'
Some links below are affiliate links. If you buy through them we may earn a small commission at no extra cost to you — it helps keep DataEngPrep free.
According to DataEngPrep.tech, this is one of the most frequently asked General/Other interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.