Bird
0
0

Given the cron expression "0 0/15 9-17 * * ?" in a Spring Boot @Scheduled annotation, how often will the task run during working hours?

medium📝 component behavior Q4 of 15
Spring Boot - Async Processing
Given the cron expression "0 0/15 9-17 * * ?" in a Spring Boot @Scheduled annotation, how often will the task run during working hours?
AEvery 15 minutes all day
BEvery hour between 9 AM and 5 PM
CEvery 15 minutes between 9 AM and 5 PM
DOnly at 9 AM and 5 PM
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the cron expression parts

    "0 0/15 9-17 * * ?" means at 0 seconds, every 15 minutes (0/15) from hour 9 to 17 (5 PM), every day.
  2. Step 2: Interpret the schedule

    The task runs every 15 minutes starting at 9:00 AM until 5:59 PM (hours 9 through 17).
  3. Final Answer:

    Every 15 minutes between 9 AM and 5 PM -> Option C
  4. Quick Check:

    0/15 in minutes + 9-17 hours = every 15 mins during work hours [OK]
Quick Trick: Use '0/15' in minutes for every 15 minutes [OK]
Common Mistakes:
  • Thinking 9-17 means only 9 AM and 5 PM
  • Confusing 0/15 with every hour
  • Ignoring the seconds field

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes