What will be the access_level for a user with role 'guest'?
medium
A. limited
B. admin
C. none
D. full
Solution
Step 1: Check user role condition
The code checks if user_role is 'admin'. If yes, access_level is 'full'.
Step 2: Apply role 'guest'
Since 'guest' is not 'admin', the else part runs, setting access_level to 'limited'.
Final Answer:
limited -> Option A
Quick Check:
Role 'guest' ≠ 'admin' -> limited access [OK]
Hint: If not admin, access is limited [OK]
Common Mistakes:
Assuming guest gets full access
Confusing role names
Ignoring else condition
4. A cloud governance policy states:
if data_sensitivity = 'high':
encrypt_data()
else:
store_data()
What is wrong with this code?
medium
A. The assignment operator '=' is used instead of comparison '=='
B. The function encrypt_data() is missing parameters
C. The else block should come before if
D. There is no error in the code
Solution
Step 1: Identify operator usage in condition
The code uses '=' which assigns value, but conditions need '==' to compare.
Step 2: Understand correct syntax
Using '=' in if condition causes error; '==' must be used to check equality.
Final Answer:
The assignment operator '=' is used instead of comparison '==' -> Option A
Quick Check:
Use '==' for comparison in conditions [OK]
Hint: Use '==' to compare, not '=' [OK]
Common Mistakes:
Confusing assignment '=' with comparison '=='
Thinking else must come before if
Assuming missing parameters cause error here
5. A company wants to ensure cloud compliance by automatically checking if all stored data is encrypted and backed up daily. Which approach best supports this goal?
hard
A. Manually review data encryption once a year
B. Allow users to decide when to encrypt and backup data
C. Ignore backup policies if encryption is enabled
D. Use automated tools to monitor encryption and backup status continuously
Solution
Step 1: Understand compliance needs
Compliance requires consistent and timely checks for encryption and backups.
Step 2: Evaluate approaches
Manual yearly reviews are too slow; user choice is risky; ignoring backup breaks compliance.
Step 3: Choose best approach
Automated continuous monitoring ensures rules are always followed and issues caught early.
Final Answer:
Use automated tools to monitor encryption and backup status continuously -> Option D
Quick Check:
Automation ensures constant compliance [OK]
Hint: Automate checks for constant compliance [OK]