Bird
Raised Fist0
HLDsystem_design~10 mins

Alerting thresholds in HLD - Interactive Code Practice

Choose your learning style10 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.

Practice

(1/5)
1. What is the primary purpose of setting alerting thresholds in system design?
easy
A. To delay notifications until issues become critical
B. To increase system resource usage
C. To reduce the number of system logs generated
D. To detect problems early before they impact users

Solution

  1. Step 1: Understand alerting thresholds role

    Alerting thresholds are set to monitor system metrics and detect anomalies early.
  2. Step 2: Identify the main goal

    The main goal is to catch issues before they affect users or cause downtime.
  3. Final Answer:

    To detect problems early before they impact users -> Option D
  4. Quick Check:

    Alerting thresholds = Early problem detection [OK]
Hint: Alerting thresholds catch issues early to protect users [OK]
Common Mistakes:
  • Thinking thresholds increase resource use
  • Believing thresholds delay notifications
  • Confusing thresholds with log management
2. Which of the following is a valid component of an alerting threshold configuration?
easy
A. User interface color scheme
B. Metric name to monitor
C. Database schema version
D. Network cable length

Solution

  1. Step 1: Identify components of alerting thresholds

    Alerting thresholds include metric names, threshold values, comparison operators, duration, severity, and notification methods.
  2. Step 2: Match valid component

    Metric name is essential to specify what to monitor.
  3. Final Answer:

    Metric name to monitor -> Option B
  4. Quick Check:

    Alert config includes metric name [OK]
Hint: Alert configs always include metric names [OK]
Common Mistakes:
  • Confusing UI settings with alert configs
  • Including unrelated hardware details
  • Mixing database schema with alert thresholds
3. Consider this alert rule: CPU usage > 80% for 5 minutes triggers WARNING. If CPU usage spikes to 85% for 3 minutes, then drops to 75%, what happens?
medium
A. WARNING alert triggers immediately at 85%
B. Alert triggers after CPU usage drops below 80%
C. No alert is triggered because duration is less than 5 minutes
D. System shuts down due to high CPU

Solution

  1. Step 1: Analyze alert condition

    The alert triggers only if CPU usage stays above 80% continuously for 5 minutes.
  2. Step 2: Evaluate given scenario

    CPU usage was above 80% for only 3 minutes, which is less than required 5 minutes, so no alert triggers.
  3. Final Answer:

    No alert is triggered because duration is less than 5 minutes -> Option C
  4. Quick Check:

    Duration condition not met = No alert [OK]
Hint: Duration must be met before alert triggers [OK]
Common Mistakes:
  • Ignoring duration and alerting immediately
  • Assuming alert triggers after usage drops
  • Confusing alert severity with system shutdown
4. You have an alert threshold: Memory usage >= 90% for 10 minutes triggers CRITICAL. The alert never fires even when memory usage is 95% for 15 minutes. What is the most likely issue?
medium
A. The monitoring system is not collecting memory metrics correctly
B. The comparison operator should be > instead of >=
C. The alert duration is set too low
D. The notification channel is misconfigured

Solution

  1. Step 1: Check alert condition correctness

    The condition uses >= 90% for 10 minutes, which is valid and should trigger if memory usage is 95% for 15 minutes.
  2. Step 2: Identify why alert doesn't fire

    If alert doesn't fire despite condition met, likely the monitoring system is not reporting memory usage correctly.
  3. Final Answer:

    The monitoring system is not collecting memory metrics correctly -> Option A
  4. Quick Check:

    Metrics missing = Alert won't trigger [OK]
Hint: Check metric collection if alerts don't trigger [OK]
Common Mistakes:
  • Changing valid comparison operators unnecessarily
  • Assuming duration is too low when it's sufficient
  • Blaming notification without checking metrics
5. You design an alerting system with thresholds for CPU, memory, and disk usage. To avoid alert fatigue, which strategy is best?
hard
A. Use multi-level severity with increasing thresholds and durations
B. Disable alerts during business hours
C. Send alerts for every metric spike immediately
D. Set thresholds too low to catch all minor issues

Solution

  1. Step 1: Understand alert fatigue

    Alert fatigue happens when too many alerts overwhelm responders, causing important alerts to be missed.
  2. Step 2: Choose strategy to reduce noise

    Using multi-level severity with increasing thresholds and durations helps prioritize critical alerts and reduce noise from minor fluctuations.
  3. Final Answer:

    Use multi-level severity with increasing thresholds and durations -> Option A
  4. Quick Check:

    Multi-level severity reduces alert fatigue [OK]
Hint: Use severity levels and durations to reduce alert noise [OK]
Common Mistakes:
  • Setting thresholds too low causing many false alerts
  • Alerting on every spike without filtering
  • Disabling alerts during critical times
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