Bird
Raised Fist0
Azurecloud~20 mins

Right-sizing resources in Azure - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Right-Sizing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding VM Size Impact on Cost and Performance

You have two Azure virtual machines (VMs): VM1 is Standard_D2s_v3 with 2 vCPUs and 8 GB RAM, VM2 is Standard_D4s_v3 with 4 vCPUs and 16 GB RAM. Both run the same workload, but VM2 costs roughly twice as much per hour.

Which statement best explains the right-sizing principle for these VMs?

AAlways choose the VM with the highest CPU and RAM to avoid performance issues.
BSelect the VM size that matches the workload needs to avoid paying for unused capacity.
CPick the smallest VM to save costs, regardless of workload requirements.
DUse the VM with the lowest cost per hour even if it causes slow performance.
Attempts:
2 left
💡 Hint

Think about balancing cost and performance based on actual workload needs.

Configuration
intermediate
2:00remaining
Identifying Overprovisioned Azure VM Using Metrics

You monitor an Azure VM and see the following average CPU utilization over a week: 5%. Memory usage is 30%. Disk I/O and network traffic are low.

Which action best reflects right-sizing this VM?

ADownsize the VM to a smaller size to reduce costs.
BKeep the VM size unchanged as low CPU means good performance.
CIncrease the VM size to handle potential spikes.
DAdd more disks to improve I/O performance.
Attempts:
2 left
💡 Hint

Low CPU and memory usage suggest the VM might be larger than needed.

Architecture
advanced
2:00remaining
Designing a Scalable Azure App with Right-Sized Resources

You design an Azure web app expected to have variable traffic. You want to ensure right-sizing while maintaining performance and cost efficiency.

Which architecture best supports this goal?

ADeploy a single large VM with maximum capacity to handle peak traffic.
BDeploy multiple small VMs manually and switch between them based on traffic.
CUse Azure App Service with auto-scaling rules based on CPU and memory usage.
DUse a fixed number of medium VMs without scaling to simplify management.
Attempts:
2 left
💡 Hint

Consider how Azure services can automatically adjust resources based on demand.

security
advanced
2:00remaining
Security Risks of Overprovisioned Resources

What is a potential security risk of keeping overprovisioned Azure resources running unnecessarily?

AIncreased attack surface due to more active resources than needed.
BSecurity risks are unrelated to resource sizing.
COverprovisioned resources disable Azure Security Center alerts.
DAutomatic patching will fail on larger VMs.
Attempts:
2 left
💡 Hint

Think about how more resources can affect exposure to threats.

service_behavior
expert
2:00remaining
Effect of Right-Sizing on Azure Cost Management Reports

You right-size several Azure VMs by downsizing them after monitoring usage. After one month, what change will you most likely see in Azure Cost Management reports?

AStorage costs increase because smaller VMs use more disks.
BThe cost remains the same because billing is based on VM count, not size.
CCosts increase due to additional monitoring charges for right-sizing.
DThe total compute cost decreases reflecting smaller VM sizes.
Attempts:
2 left
💡 Hint

Consider how VM size affects billing in Azure.

Practice

(1/5)
1. What does right-sizing mean in Azure cloud resource management?
easy
A. Buying the largest possible resources to avoid any performance issues
B. Choosing the best size for your cloud resources to save cost and improve performance
C. Using only free-tier resources regardless of workload needs
D. Deleting unused resources without checking their usage

Solution

  1. Step 1: Understand the term 'right-sizing'

    Right-sizing means selecting the most appropriate size of cloud resources based on actual workload needs.
  2. Step 2: Identify the benefits of right-sizing

    It helps save money by avoiding over-provisioning and improves performance by matching resources to demand.
  3. Final Answer:

    Choosing the best size for your cloud resources to save cost and improve performance -> Option B
  4. Quick Check:

    Right-sizing = Best size choice [OK]
Hint: Right-sizing means matching resource size to workload needs [OK]
Common Mistakes:
  • Thinking bigger is always better
  • Ignoring cost savings
  • Confusing right-sizing with deleting resources
2. Which Azure CLI command sequence correctly resizes a virtual machine named myVM to size Standard_DS2_v2?
easy
A. az vm stop --name myVM && az vm resize --name myVM --size Standard_DS2_v2 && az vm start --name myVM
B. az vm resize --name myVM --size Standard_DS2_v2 && az vm stop --name myVM && az vm start --name myVM
C. az vm start --name myVM && az vm resize --name myVM --size Standard_DS2_v2 && az vm stop --name myVM
D. az vm start --name myVM && az vm stop --name myVM && az vm resize --name myVM --size Standard_DS2_v2

Solution

  1. Step 1: Stop the VM before resizing

    Azure requires the VM to be stopped before changing its size to avoid errors.
  2. Step 2: Resize and then start the VM

    After stopping, resize the VM, then start it again to apply changes.
  3. Final Answer:

    az vm stop --name myVM && az vm resize --name myVM --size Standard_DS2_v2 && az vm start --name myVM -> Option A
  4. Quick Check:

    Stop, resize, start = correct order [OK]
Hint: Always stop VM before resizing, then start it [OK]
Common Mistakes:
  • Trying to resize while VM is running
  • Starting VM before resizing
  • Wrong command order causing errors
3. Given this Azure CLI snippet, what will be the output status of the VM after execution?
az vm stop --name testVM && az vm resize --name testVM --size Standard_B1s && az vm start --name testVM && az vm show --name testVM --query "powerState" -o tsv
medium
A. VM will be running
B. VM will be stopped
C. VM will be deallocated
D. Command will fail due to wrong order

Solution

  1. Step 1: Analyze command sequence

    The VM is stopped, resized, then started, and finally its power state is queried.
  2. Step 2: Determine VM state after commands

    Since the VM is started before querying, the power state will show as running.
  3. Final Answer:

    VM will be running -> Option A
  4. Quick Check:

    Stop, resize, start, then check = running [OK]
Hint: Last command starts VM before checking state [OK]
Common Mistakes:
  • Assuming VM stays stopped after start command
  • Confusing deallocated with stopped
  • Ignoring command order effects
4. You tried to resize an Azure VM using:
az vm resize --name myVM --size Standard_DS3_v2

but got an error. What is the most likely cause?
medium
A. You need to start the VM before resizing
B. The VM name is incorrect
C. The size Standard_DS3_v2 does not exist
D. The VM is currently running and must be stopped before resizing

Solution

  1. Step 1: Understand Azure VM resize requirements

    Azure requires the VM to be stopped before resizing to avoid conflicts.
  2. Step 2: Identify common error causes

    If the VM is running, resize commands fail with an error prompting to stop the VM first.
  3. Final Answer:

    The VM is currently running and must be stopped before resizing -> Option D
  4. Quick Check:

    VM must be stopped before resize [OK]
Hint: Stop VM before resizing to avoid errors [OK]
Common Mistakes:
  • Trying to resize running VM
  • Assuming VM name typo without checking
  • Believing VM must be started before resize
5. You have a VM running with size Standard_DS4_v2 but your monitoring shows only 20% CPU usage consistently. Which is the best right-sizing approach to reduce costs without impacting performance?
hard
A. Resize the VM to Standard_DS1_v2 while it is running
B. Keep the current size since resizing may cause downtime
C. Resize the VM to Standard_DS2_v2 after stopping it, then start it again
D. Delete the VM and create a new smaller VM

Solution

  1. Step 1: Analyze CPU usage and sizing

    Low CPU usage (20%) suggests the VM is over-provisioned and can be downsized safely.
  2. Step 2: Choose a smaller size and follow correct resize steps

    Resizing to Standard_DS2_v2 reduces cost and maintains performance. Stop VM before resizing, then start it.
  3. Final Answer:

    Resize the VM to Standard_DS2_v2 after stopping it, then start it again -> Option C
  4. Quick Check:

    Stop, resize smaller, start = cost saving [OK]
Hint: Downsize VM after stopping to save cost safely [OK]
Common Mistakes:
  • Resizing while VM is running
  • Ignoring low CPU usage signals
  • Deleting VM unnecessarily