0
0
HLDsystem_design~10 mins

Health checks in HLD - Interactive Code Practice

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

Complete the code to define a health check endpoint that returns a success status.

HLD
GET /health [1] 200 OK
Drag options to blanks, or click blank then click option'
Aresponds_with
Breturns
Csends
Doutputs
Attempts:
3 left
💡 Hint
Common Mistakes
Using verbs like 'responds_with' or 'sends' which are not standard in endpoint definitions.
2fill in blank
medium

Complete the code to specify the type of health check that verifies database connectivity.

HLD
HealthCheck: type = [1]
Drag options to blanks, or click blank then click option'
Adatabase
Bdisk
Cmemory
Dcpu
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing database check with disk or memory checks.
3fill in blank
hard

Fix the error in the health check configuration to correctly set the check interval.

HLD
check_interval = [1] seconds
Drag options to blanks, or click blank then click option'
A5
Bfive_seconds
C'5'
Dfive
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like 'five' or strings like '5' instead of numeric 5.
4fill in blank
hard

Fill both blanks to complete the health check response indicating service status and uptime.

HLD
response = {"status": "[1]", "uptime": [2]
Drag options to blanks, or click blank then click option'
Ahealthy
Bunhealthy
Cuptime_seconds
Duptime
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'unhealthy' for status when service is healthy.
Using incorrect key names for uptime.
5fill in blank
hard

Fill all three blanks to define a health check function that returns true if the service is healthy and false otherwise.

HLD
def is_healthy():
    if [1] == 'ok' and [2] < [3]:
        return True
    else:
        return False
Drag options to blanks, or click blank then click option'
Aservice_status
Bresponse_time
Ctimeout_threshold
Derror_count
Attempts:
3 left
💡 Hint
Common Mistakes
Using error_count instead of response_time or timeout_threshold.