Bird
Raised Fist0
Software Engineeringknowledge~10 mins

Risk monitoring and control in Software Engineering - 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 risk monitoring function that logs risk status.

Software Engineering
def monitor_risk(risk_level):
    if risk_level > 5:
        [1]("High risk detected")
Drag options to blanks, or click blank then click option'
Alog
Bnotify
Cprint
Dalert
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined functions like 'log' or 'alert' without imports.
2fill in blank
medium

Complete the code to check if the risk status is 'critical' and trigger an alert.

Software Engineering
risk_status = 'critical'
if risk_status == [1]:
    print('Alert: Critical risk!')
Drag options to blanks, or click blank then click option'
A'high'
B'critical'
C'medium'
D'low'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around string literals.
3fill in blank
hard

Fix the error in the code to correctly update the risk level in the dictionary.

Software Engineering
risk_data = {'level': 3}
risk_data['level'] [1] 7
Drag options to blanks, or click blank then click option'
A-=
B==
C+=
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '=' for assignment.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters risks with level greater than 4.

Software Engineering
filtered_risks = {k: v for k, v in risks.items() if v [1] [2]
Drag options to blanks, or click blank then click option'
A>
B4
C<
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' causing wrong filtering.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that converts risk names to uppercase and filters risks with level at least 3.

Software Engineering
result = { [1]: [2] for [3] in risk_dict.items() if [2] >= 3 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck, v
Drisk_dict
Attempts:
3 left
💡 Hint
Common Mistakes
Using the dictionary name instead of key variable in comprehension.

Practice

(1/5)
1. What is the main goal of risk monitoring and control in DevOps projects?
easy
A. To ignore risks until they cause problems
B. To create risks so the team can practice handling them
C. To document risks once at the start and never update
D. To continuously watch risks and act quickly to reduce their impact

Solution

  1. Step 1: Understand risk monitoring purpose

    Risk monitoring means watching risks regularly to see if they change or get worse.
  2. Step 2: Identify the correct goal

    The goal is to act fast to reduce risk impact, not ignore or create risks.
  3. Final Answer:

    To continuously watch risks and act quickly to reduce their impact -> Option D
  4. Quick Check:

    Risk monitoring = watch and act fast [OK]
Hint: Risk monitoring means watch and act fast, not ignore [OK]
Common Mistakes:
  • Thinking risk monitoring means ignoring risks
  • Believing risks should be created intentionally
  • Assuming risks are documented once and never updated
2. Which of the following commands is commonly used to check the status of running services for risk monitoring in a Linux environment?
easy
A. docker build
B. git commit
C. systemctl status
D. kubectl apply

Solution

  1. Step 1: Identify commands related to service status

    In Linux, systemctl status shows the current status of system services.
  2. Step 2: Eliminate unrelated commands

    git commit is for version control, docker build builds images, kubectl apply manages Kubernetes resources.
  3. Final Answer:

    systemctl status -> Option C
  4. Quick Check:

    Check service status = systemctl status [OK]
Hint: Use systemctl status to check Linux services quickly [OK]
Common Mistakes:
  • Confusing git commands with system monitoring
  • Using docker build instead of status commands
  • Mixing Kubernetes commands with local service checks
3. Given this snippet of a monitoring script output:
ALERT: Disk space usage at 92% on /dev/sda1
ACTION: Trigger cleanup script
STATUS: Cleanup completed successfully
ALERT: CPU usage at 85%

What is the next logical step in risk control?
medium
A. Ignore the CPU alert since cleanup was successful
B. Investigate and reduce CPU usage to prevent overload
C. Reboot the server immediately without checking
D. Delete all logs to free disk space

Solution

  1. Step 1: Analyze the alerts and actions

    The disk space alert was handled by cleanup successfully, but CPU usage is still high at 85%.
  2. Step 2: Decide the correct risk control action

    Ignoring CPU alert risks overload; rebooting immediately or deleting logs are extreme or unsafe actions.
  3. Final Answer:

    Investigate and reduce CPU usage to prevent overload -> Option B
  4. Quick Check:

    High CPU alert = investigate and reduce [OK]
Hint: Address each alert; don't ignore new ones after fixing old [OK]
Common Mistakes:
  • Ignoring new alerts after fixing previous ones
  • Taking drastic actions without investigation
  • Deleting logs which may be needed for diagnosis
4. You have a monitoring script that should alert when memory usage exceeds 80%, but it never triggers alerts even when usage is 90%. What is the most likely cause?
medium
A. The alert threshold is set incorrectly above 90%
B. The script is missing execution permissions
C. The monitoring tool is not installed
D. The server has no memory usage

Solution

  1. Step 1: Check alert threshold settings

    If alerts never trigger at 90%, the threshold might be set higher than 90%, so condition never met.
  2. Step 2: Evaluate other options

    Missing permissions or tool not installed would cause no script run or errors, not silent no alerts. Server always uses some memory.
  3. Final Answer:

    The alert threshold is set incorrectly above 90% -> Option A
  4. Quick Check:

    Alerts not triggering = check threshold settings [OK]
Hint: Check alert thresholds first if alerts never trigger [OK]
Common Mistakes:
  • Assuming script permission issues without checking thresholds
  • Thinking server can have zero memory usage
  • Ignoring tool installation status
5. In a DevOps pipeline, you want to implement risk monitoring that automatically pauses deployment if test failures exceed 5%. Which combination of tools and steps best achieves this?
hard
A. Use a CI tool with test reports and configure a gate to stop deployment on failure threshold
B. Manually check test logs after deployment and rollback if needed
C. Deploy first, then run tests and notify team by email only
D. Ignore test failures and deploy continuously without checks

Solution

  1. Step 1: Identify automated risk monitoring needs

    Automatic pause on failure requires integration of test results with deployment control.
  2. Step 2: Choose correct tool and configuration

    CI tools can generate test reports and enforce gates to stop deployment if failures exceed limits.
  3. Final Answer:

    Use a CI tool with test reports and configure a gate to stop deployment on failure threshold -> Option A
  4. Quick Check:

    Automate risk control = CI gate on test failures [OK]
Hint: Use CI gates to auto-stop deployment on test failures [OK]
Common Mistakes:
  • Relying on manual checks after deployment
  • Running tests post-deployment without blocking
  • Ignoring test failures completely
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