Bird
Raised Fist0
Computer Networksknowledge~20 mins

TCP vs UDP comparison in Computer Networks - Practice Questions

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
TCP vs UDP Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Comparison
intermediate
2:00remaining
Key Difference Between TCP and UDP
Which of the following best describes a fundamental difference between TCP and UDP?
AUDP establishes a connection before sending data; TCP sends data without establishing a connection.
BTCP is connection-oriented, ensuring reliable data transfer; UDP is connectionless and does not guarantee delivery.
CTCP is faster than UDP because it has less overhead.
DUDP guarantees data order and error checking, while TCP does not.
Attempts:
2 left
💡 Hint
Think about whether the protocols establish a connection and how they handle data delivery.
🧠 Conceptual
intermediate
2:00remaining
Use Cases for UDP
Why might an application choose UDP over TCP?
ABecause UDP is faster and suitable for real-time applications where speed is more important than reliability.
BBecause UDP provides guaranteed delivery and error correction.
CBecause UDP requires a connection setup which improves security.
DBecause UDP automatically resends lost packets.
Attempts:
2 left
💡 Hint
Consider applications like live video or gaming where delays are bad.
📋 Factual
advanced
2:00remaining
Port Numbers in TCP and UDP
Which statement about port numbers in TCP and UDP is correct?
APort numbers are not used in UDP.
BTCP and UDP use completely different port number ranges.
CA port number can only be used by either TCP or UDP, never both.
DTCP and UDP can use the same port numbers independently for different services.
Attempts:
2 left
💡 Hint
Think about how services like DNS use UDP and TCP on the same port number.
❓ Reasoning
advanced
2:00remaining
Impact of Protocol Choice on Data Transmission
If a file transfer application uses UDP instead of TCP, what is the most likely outcome?
AThe file will always transfer faster and without errors.
BThe file transfer will be slower because UDP adds extra error checking.
CThe file may transfer faster but could be incomplete or corrupted due to lost packets.
DThe file transfer will be secure because UDP encrypts data by default.
Attempts:
2 left
💡 Hint
Consider what UDP does not provide compared to TCP.
🔍 Analysis
expert
2:00remaining
Analyzing Protocol Behavior Under Network Congestion
During heavy network congestion, how do TCP and UDP behave differently?
ATCP reduces its sending rate to avoid congestion; UDP continues sending at the same rate regardless of congestion.
BUDP reduces its sending rate to avoid congestion; TCP continues sending at the same rate regardless of congestion.
CBoth TCP and UDP reduce their sending rates equally during congestion.
DNeither TCP nor UDP adjust their sending rates during congestion.
Attempts:
2 left
💡 Hint
Think about which protocol is designed to be 'friendly' to the network.

Practice

(1/5)
1. Which of the following is a key characteristic of TCP compared to UDP?
easy
A. It is used mainly for streaming videos.
B. It is faster but may lose data.
C. It does not establish a connection before sending data.
D. It guarantees data delivery and order.

Solution

  1. Step 1: Understand TCP's main feature

    TCP ensures reliable communication by guaranteeing data delivery and maintaining the order of packets.
  2. Step 2: Compare with UDP characteristics

    UDP is faster but does not guarantee delivery or order, unlike TCP.
  3. Final Answer:

    It guarantees data delivery and order. -> Option D
  4. Quick Check:

    TCP = Reliable and ordered delivery [OK]
Hint: TCP is reliable; UDP is faster but less reliable [OK]
Common Mistakes:
  • Confusing UDP as reliable
  • Thinking TCP is faster than UDP
  • Assuming UDP guarantees order
2. Which syntax correctly describes the connection type of UDP?
easy
A. Connectionless protocol
B. Connection-oriented protocol
C. Reliable data transfer protocol
D. Protocol that uses handshaking

Solution

  1. Step 1: Identify UDP connection type

    UDP is a connectionless protocol, meaning it sends data without establishing a connection first.
  2. Step 2: Contrast with TCP

    TCP is connection-oriented and uses handshaking to establish a connection before data transfer.
  3. Final Answer:

    Connectionless protocol -> Option A
  4. Quick Check:

    UDP = Connectionless [OK]
Hint: UDP sends data without connection setup [OK]
Common Mistakes:
  • Thinking UDP uses handshaking
  • Confusing UDP with TCP's connection type
  • Assuming UDP guarantees delivery
3. Consider this scenario: A video call uses UDP instead of TCP. What is the most likely outcome?
medium
A. The call will be slow but never lose any data.
B. The call will establish a connection before sending data.
C. The call may have some lost or out-of-order packets but will be faster.
D. The call will guarantee all data arrives correctly and in order.

Solution

  1. Step 1: Understand UDP behavior in real-time apps

    UDP is used in real-time apps like video calls because it is faster but may lose or reorder packets.
  2. Step 2: Compare with TCP's behavior

    TCP guarantees delivery and order but is slower, which can cause delays in live calls.
  3. Final Answer:

    The call may have some lost or out-of-order packets but will be faster. -> Option C
  4. Quick Check:

    UDP = Faster but less reliable [OK]
Hint: UDP favors speed over reliability in live streams [OK]
Common Mistakes:
  • Assuming UDP guarantees delivery
  • Thinking TCP is better for live video calls
  • Confusing connection setup with UDP
4. A developer wrote this statement: "UDP guarantees data arrives in order." What is wrong with this statement?
medium
A. UDP does not guarantee data order or delivery.
B. UDP is slower than TCP.
C. UDP requires a connection before sending data.
D. UDP uses handshaking to ensure reliability.

Solution

  1. Step 1: Analyze UDP's delivery guarantees

    UDP does not guarantee that data packets arrive in order or even arrive at all.
  2. Step 2: Identify the incorrect claim

    The statement incorrectly claims UDP guarantees order, which is false.
  3. Final Answer:

    UDP does not guarantee data order or delivery. -> Option A
  4. Quick Check:

    UDP = No order or delivery guarantee [OK]
Hint: UDP is unreliable; no order guarantee [OK]
Common Mistakes:
  • Confusing UDP with TCP reliability
  • Assuming UDP uses connection setup
  • Believing UDP is slower than TCP
5. You need to design a system that streams live sports scores with minimal delay, but occasional lost updates are acceptable. Which protocol should you choose and why?
hard
A. TCP, because it guarantees all data arrives in order.
B. UDP, because it is faster and tolerates some data loss.
C. TCP, because it does not require connection setup.
D. UDP, because it guarantees reliable delivery.

Solution

  1. Step 1: Identify system requirements

    The system needs minimal delay and can tolerate some lost data, typical for live updates.
  2. Step 2: Match protocol to requirements

    UDP is faster and allows some data loss, making it suitable for live streaming where speed matters more than perfect accuracy.
  3. Step 3: Eliminate incorrect options

    TCP guarantees delivery but is slower and requires connection setup; UDP does not guarantee delivery but is faster.
  4. Final Answer:

    UDP, because it is faster and tolerates some data loss. -> Option B
  5. Quick Check:

    Live updates = UDP for speed and tolerance [OK]
Hint: Use UDP for speed when some loss is okay [OK]
Common Mistakes:
  • Choosing TCP for real-time updates needing speed
  • Assuming UDP guarantees delivery
  • Ignoring connection setup overhead
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard