0
0
HLDsystem_design~10 mins

Alerting thresholds 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 threshold that triggers an alert when CPU usage exceeds a limit.

HLD
if cpu_usage [1] threshold:
    trigger_alert()
Drag options to blanks, or click blank then click option'
A==
B<
C>
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' causes alerts to trigger incorrectly.
2fill in blank
medium

Complete the code to set a memory alert threshold at 80%.

HLD
memory_alert_threshold = [1]
Drag options to blanks, or click blank then click option'
A1.0
B0.8
C0.5
D0.3
Attempts:
3 left
💡 Hint
Common Mistakes
Using 80 instead of 0.8 causes incorrect threshold interpretation.
3fill in blank
hard

Fix the error in the alert condition to correctly trigger when disk space is below the threshold.

HLD
if disk_space [1] threshold:
    trigger_alert()
Drag options to blanks, or click blank then click option'
A>
B>=
C==
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' triggers alert when disk space is sufficient, which is wrong.
4fill in blank
hard

Fill both blanks to create a threshold check that triggers an alert if response time is greater than 200ms and error rate is above 5%.

HLD
if response_time [1] 200 and error_rate [2] 0.05:
    trigger_alert()
Drag options to blanks, or click blank then click option'
A>
B<
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' causes alerts to trigger incorrectly when metrics are low.
5fill in blank
hard

Fill all three blanks to define a dictionary of alert thresholds for CPU, memory, and disk usage.

HLD
alert_thresholds = {
    'cpu': [1],
    'memory': [2],
    'disk': [3]
}
Drag options to blanks, or click blank then click option'
A0.75
B0.8
C0.9
D0.85
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up threshold values for different resources.