0
0
Spring Bootframework

Cron expressions for scheduling in Spring Boot - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a cron expression in Spring Boot scheduling?
A cron expression is a string that defines a schedule using six or seven fields to specify seconds, minutes, hours, day of month, month, day of week, and optionally year. Spring Boot uses it to run tasks at specific times.
Click to reveal answer
beginner
What does the cron expression "0 0 12 * * ?" mean in Spring Boot?
It means the task runs every day at 12:00 PM (noon). The fields represent: 0 seconds, 0 minutes, 12 hours, every day of month, every month, any day of week.
Click to reveal answer
intermediate
How many fields are there in a Spring Boot cron expression and what are they?
There are 6 or 7 fields: seconds, minutes, hours, day of month, month, day of week, and optionally year.
Click to reveal answer
intermediate
What does the special character '?' mean in a cron expression?
The '?' character means 'no specific value'. It is used in either day of month or day of week fields to avoid conflicts when one is specified and the other is not.
Click to reveal answer
beginner
How do you schedule a task to run every 5 minutes using a cron expression in Spring Boot?
Use the expression "0 0/5 * * * ?" which means: 0 seconds, every 5 minutes, every hour, every day, every month, any day of week.
Click to reveal answer
How many fields does a Spring Boot cron expression typically have?
A4
B5
C6 or 7
D8
What does the cron expression "0 15 10 * * ?" do?
ARuns at 3:10 PM every day
BRuns at 10:15 AM every day
CRuns every 10 minutes
DRuns at 15 minutes past every hour
Which character in a cron expression means 'any value'?
A*
B?
C/
D-
In Spring Boot cron expressions, what does the '?' character do?
ASpecifies a list of values
BMeans every value
CSpecifies a range
DNo specific value, used to avoid conflicts
How would you write a cron expression to run a task every hour at the 0th minute?
A0 0 * * * ?
B0 * * * * ?
C* 0 * * * ?
D0 0 0 * * ?
Explain the structure of a Spring Boot cron expression and what each field represents.
Think about the time units from smallest to largest and special optional parts.
You got /8 concepts.
    Describe how you would schedule a task to run every weekday at 9 AM using a cron expression in Spring Boot.
    Use '?' to avoid conflicts and specify weekdays in day of week.
    You got /4 concepts.