0
0
HLDsystem_design~10 mins

Why understanding protocols enables design decisions in HLD - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the protocol used for communication.

HLD
if message.protocol == '[1]':
    process_http(message)
Drag options to blanks, or click blank then click option'
AHTTP
BSMTP
CFTP
DTCP
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing HTTP with FTP or SMTP protocols.
2fill in blank
medium

Complete the code to select the right protocol for secure data transfer.

HLD
if use_encryption:
    protocol = '[1]'
else:
    protocol = 'HTTP'
Drag options to blanks, or click blank then click option'
AFTP
BTCP
CHTTPS
DSMTP
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing FTP or TCP which are not secure by default.
3fill in blank
hard

Fix the error in the protocol check to avoid runtime failure.

HLD
if message.protocol == [1]:
    process_message(message)
Drag options to blanks, or click blank then click option'
AHttp
BHTTP
Chttp
D'HTTP'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted protocol names causing syntax errors.
4fill in blank
hard

Fill both blanks to correctly define a protocol handler function.

HLD
def handle_[1](message):
    if message.protocol == '[2]':
        process_[1](message)
Drag options to blanks, or click blank then click option'
Ahttp
Bftp
CHTTP
DFTP
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing case between function name and protocol string.
5fill in blank
hard

Fill all three blanks to create a dictionary mapping protocols to ports.

HLD
protocol_ports = {
    '[1]': [2],
    '[3]': 443
}
Drag options to blanks, or click blank then click option'
AHTTP
B80
CHTTPS
D21
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing port numbers or protocol names.