0
0
Azurecloud~5 mins

Conditional access policies in Azure - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Conditional access policies
O(n)
Understanding Time Complexity

When using conditional access policies, it's important to know how the system handles many users and conditions.

We want to understand how the time to evaluate policies grows as more users or conditions are added.

Scenario Under Consideration

Analyze the time complexity of evaluating conditional access policies for user sign-in.

// Pseudocode for conditional access evaluation
foreach (policy in policies) {
  if (policy.conditions match user) {
    apply policy controls;
  }
}

This sequence checks each policy against the user sign-in details to decide access controls.

Identify Repeating Operations

Look at what repeats when evaluating policies.

  • Primary operation: Checking each policy's conditions against the user sign-in.
  • How many times: Once for each policy in the system.
How Execution Grows With Input

As the number of policies grows, the system checks more conditions for each sign-in.

Input Size (n)Approx. Api Calls/Operations
10 policies10 condition checks
100 policies100 condition checks
1000 policies1000 condition checks

Pattern observation: The number of checks grows directly with the number of policies.

Final Time Complexity

Time Complexity: O(n)

This means the time to evaluate policies grows in a straight line as more policies are added.

Common Mistake

[X] Wrong: "Adding more policies won't affect evaluation time much because they run in parallel."

[OK] Correct: Even if some checks run at the same time, each policy still needs to be checked, so total work grows with the number of policies.

Interview Connect

Understanding how conditional access scales helps you design secure and efficient cloud systems that handle many users smoothly.

Self-Check

"What if policies were grouped and evaluated by category instead of individually? How would that change the time complexity?"