Bird
Raised Fist0
AWScloud~20 mins

Scheduled scaling in AWS - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Scheduled Scaling Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
Understanding Scheduled Scaling Behavior

You configure an AWS Auto Scaling group with a scheduled scaling action to increase the desired capacity from 2 to 5 instances at 8:00 AM daily. What happens if the current desired capacity is already 6 instances at 8:00 AM?

AThe desired capacity is reduced to 5 instances at 8:00 AM as per the scheduled action.
BThe desired capacity remains at 6 instances; the scheduled action does not reduce capacity.
CThe scheduled action fails and triggers an error notification.
DThe Auto Scaling group terminates one instance immediately to match the scheduled capacity.
Attempts:
2 left
💡 Hint

Scheduled scaling actions set the desired capacity to the specified value and can scale in or out.

❓ Configuration
intermediate
2:00remaining
Correct Scheduled Scaling Configuration

Which of the following AWS CLI commands correctly creates a scheduled scaling action to increase the desired capacity of an Auto Scaling group named webserver-group to 10 instances at 6:00 PM UTC daily?

Aaws autoscaling put-scheduled-update-group-action --auto-scaling-group-name webserver-group --scheduled-action-name scale-up-evening --start-time 18:00 --desired-capacity 10
Baws autoscaling put-scheduled-update-group-action --auto-scaling-group-name webserver-group --scheduled-action-name scale-up-evening --start-time 2024-06-01T18:00:00Z --desired-capacity 10 --recurrence '0 18 * * *'
Caws autoscaling put-scheduled-update-group-action --auto-scaling-group-name webserver-group --scheduled-action-name scale-up-evening --start-time 2024-06-01T18:00:00Z --desired-capacity 10
Daws autoscaling put-scheduled-update-group-action --auto-scaling-group-name webserver-group --scheduled-action-name scale-up-evening --recurrence '0 18 * * *' --desired-capacity 10
Attempts:
2 left
💡 Hint

Scheduled scaling requires either a start time or a recurrence expression for repeated actions.

❓ Architecture
advanced
2:00remaining
Designing Scheduled Scaling for Cost Optimization

You manage an application with predictable traffic spikes from 9 AM to 5 PM on weekdays. You want to optimize costs by scaling out before 9 AM and scaling in after 5 PM. Which architecture best supports this using AWS scheduled scaling?

AConfigure scheduled scaling to increase capacity at 9 AM and decrease capacity at 5 PM every day including weekends.
BUse a single scheduled scaling action to set desired capacity to high at 9 AM and rely on manual scaling to reduce capacity after 5 PM.
CCreate two scheduled scaling actions: one to increase desired capacity at 8:45 AM and another to decrease desired capacity at 5:15 PM on weekdays.
DUse dynamic scaling policies triggered by CPU utilization thresholds instead of scheduled scaling.
Attempts:
2 left
💡 Hint

Think about timing and days when traffic spikes occur.

❓ security
advanced
2:00remaining
Security Best Practices for Scheduled Scaling

Which IAM policy statement least restricts permissions while allowing a user to create and manage scheduled scaling actions for a specific Auto Scaling group named app-group?

A{"Effect": "Allow", "Action": ["autoscaling:PutScheduledUpdateGroupAction", "autoscaling:DeleteScheduledAction"], "Resource": "arn:aws:autoscaling:*:*:autoScalingGroup:*:autoScalingGroupName/app-group"}
B{"Effect": "Allow", "Action": "autoscaling:*", "Resource": "*"}
C{"Effect": "Allow", "Action": ["autoscaling:PutScheduledUpdateGroupAction"], "Resource": "*"}
D{"Effect": "Allow", "Action": ["autoscaling:PutScheduledUpdateGroupAction", "autoscaling:DeleteScheduledAction"], "Resource": "*"}
Attempts:
2 left
💡 Hint

Consider least privilege principle and resource scoping.

✅ Best Practice
expert
2:00remaining
Troubleshooting Scheduled Scaling Not Triggering

You set a scheduled scaling action to increase desired capacity at 7:00 AM daily, but the Auto Scaling group does not scale up as expected. Which is the most likely cause?

AThe Auto Scaling group has a minimum size higher than the scheduled desired capacity, preventing scaling.
BThe scheduled action's start time is in the past and no recurrence is set, so it only ran once and will not run again.
CThe scheduled action is missing the desired capacity parameter, so it does nothing.
DThe Auto Scaling group is in a suspended state and ignores all scaling actions.
Attempts:
2 left
💡 Hint

Check if the scheduled action is configured to repeat or only run once.

Practice

(1/5)
1. What is the main purpose of scheduled scaling in AWS?
easy
A. To automatically adjust resources at specific times
B. To manually increase server capacity when needed
C. To monitor security threats in real-time
D. To backup data at scheduled intervals

Solution

  1. Step 1: Understand scheduled scaling concept

    Scheduled scaling is designed to change resource capacity automatically based on a set schedule.
  2. Step 2: Compare options with the concept

    Only To automatically adjust resources at specific times describes automatic adjustment at specific times, matching scheduled scaling.
  3. Final Answer:

    To automatically adjust resources at specific times -> Option A
  4. Quick Check:

    Scheduled scaling = automatic timed resource adjustment [OK]
Hint: Scheduled scaling means automatic resource changes on a timer [OK]
Common Mistakes:
  • Confusing scheduled scaling with manual scaling
  • Thinking it handles security or backups
  • Assuming it reacts only to traffic, not time
2. Which of the following is a valid cron expression for scheduled scaling in AWS?
easy
A. cron(0 0 0 0 ? *)
B. cron(60 24 * * ? *)
C. cron(* * * * *)
D. cron(0 12 * * ? *)

Solution

  1. Step 1: Review cron expression format in AWS

    AWS cron expressions have six fields: minutes, hours, day-of-month, month, day-of-week, year.
  2. Step 2: Validate each option

    cron(0 12 * * ? *) is valid: minute=0, hour=12, day-of-month=*, month=*, day-of-week=?, year=*. cron(0 0 0 0 ? *) has invalid zero day-of-month and month values. cron(60 24 * * ? *) has invalid 60 minutes and 24 hours. cron(* * * * *) has only five fields, missing year.
  3. Final Answer:

    cron(0 12 * * ? *) -> Option D
  4. Quick Check:

    Valid AWS cron = 6 fields, correct ranges [OK]
Hint: AWS cron needs 6 fields with valid ranges [OK]
Common Mistakes:
  • Using 5-field cron instead of 6-field
  • Setting minutes or hours out of range
  • Confusing day-of-week and day-of-month
3. Given this scheduled scaling configuration snippet:
{"ScheduledActionName": "ScaleUpMorning", "StartTime": "2024-07-01T08:00:00Z", "DesiredCapacity": 5}

What will happen at 8 AM UTC on July 1, 2024?
medium
A. The resource capacity will be set to 5
B. The resource capacity will decrease to 0
C. The scaling action will be ignored due to missing EndTime
D. The resource capacity will remain unchanged

Solution

  1. Step 1: Understand the scheduled action parameters

    The action named "ScaleUpMorning" is set to start at 8 AM UTC on July 1, 2024, with DesiredCapacity 5.
  2. Step 2: Interpret the effect of StartTime and DesiredCapacity

    At the StartTime, the capacity will be set to 5. EndTime is optional and does not block the action.
  3. Final Answer:

    The resource capacity will be set to 5 -> Option A
  4. Quick Check:

    StartTime triggers capacity change to DesiredCapacity [OK]
Hint: StartTime sets capacity; EndTime is optional [OK]
Common Mistakes:
  • Thinking EndTime is required to trigger scaling
  • Assuming capacity decreases without explicit setting
  • Ignoring the StartTime effect
4. You created a scheduled scaling action with this cron expression:
cron(0 25 * * ? *)
Why does the scaling not trigger as expected?
medium
A. The day-of-week field is missing
B. The minute value 0 is invalid
C. The hour value 25 is invalid in cron expressions
D. The cron expression needs only 5 fields

Solution

  1. Step 1: Check the hour field in the cron expression

    The hour field is set to 25, but valid hour values are 0 to 23.
  2. Step 2: Understand cron validation rules in AWS

    AWS rejects cron expressions with invalid field values, so the scaling action won't trigger.
  3. Final Answer:

    The hour value 25 is invalid in cron expressions -> Option C
  4. Quick Check:

    Hour must be 0-23 in AWS cron [OK]
Hint: Check cron field ranges; hours max 23 [OK]
Common Mistakes:
  • Assuming minute 0 is invalid
  • Thinking day-of-week is mandatory
  • Using 5 fields instead of 6
5. You want to reduce your AWS Auto Scaling group capacity to 2 instances every night at 11 PM UTC and increase it to 10 instances every weekday morning at 7 AM UTC. Which setup correctly uses scheduled scaling to achieve this?
hard
A. Create one scheduled action with cron(0 23,7 * * ? *) setting DesiredCapacity=2 and DesiredCapacity=10
B. Create two scheduled actions: one with cron(0 23 * * ? *) setting DesiredCapacity=2, another with cron(0 7 ? * MON-FRI *) setting DesiredCapacity=10
C. Create two scheduled actions: one with rate(1 day) setting DesiredCapacity=2, another with rate(1 hour) setting DesiredCapacity=10
D. Create one scheduled action with cron(0 7 * * ? *) setting DesiredCapacity=10 only

Solution

  1. Step 1: Understand the scheduling requirements

    Capacity should be 2 at 11 PM daily and 10 at 7 AM on weekdays only.
  2. Step 2: Match cron expressions to requirements

    cron(0 23 * * ? *) runs daily at 11 PM; cron(0 7 ? * MON-FRI *) runs at 7 AM Monday to Friday. Two separate scheduled actions are needed with correct DesiredCapacity values.
  3. Final Answer:

    Create two scheduled actions: one with cron(0 23 * * ? *) setting DesiredCapacity=2, another with cron(0 7 ? * MON-FRI *) setting DesiredCapacity=10 -> Option B
  4. Quick Check:

    Separate cron for each time and capacity [OK]
Hint: Use separate scheduled actions with correct cron and capacity [OK]
Common Mistakes:
  • Trying to set two capacities in one scheduled action
  • Using rate expressions instead of cron for weekdays
  • Missing weekday restriction for morning scale-up
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