A cron expression in Airflow is a string that defines the schedule for running a task. It uses five fields to specify minute, hour, day of month, month, and day of week.
Click to reveal answer
beginner
What does the cron expression '0 12 * * *' mean in Airflow?
It means the task runs every day at 12:00 PM (noon). The fields are: minute=0, hour=12, day of month=any, month=any, day of week=any.
Click to reveal answer
intermediate
How do you schedule a task to run every Monday at 8 AM using a cron expression in Airflow?
Use the cron expression '0 8 * * 1'. This means minute=0, hour=8, any day of month, any month, and day of week=1 (Monday).
Click to reveal answer
beginner
What does the '*' symbol mean in a cron expression?
The '*' symbol means 'every' possible value for that field. For example, '*' in the month field means every month.
Click to reveal answer
intermediate
How can you run a task every 15 minutes using a cron expression in Airflow?
Use '*/15 * * * *'. The '*/15' in the minute field means every 15 minutes, and the other fields are set to run every hour, day, month, and day of week.
Click to reveal answer
What does the cron expression '30 6 * * *' schedule in Airflow?
ARuns at 6:30 AM every day
BRuns at 6:00 AM every 30 days
CRuns every 30 minutes starting at 6 AM
DRuns at 6:30 PM every day
✗ Incorrect
The first field is minutes (30), second is hour (6), so it runs at 6:30 AM daily.
Which cron expression runs a task every Sunday at midnight in Airflow?
A0 0 * * 0
B0 0 * * 7
C0 0 * * 1
D0 0 7 * *
✗ Incorrect
In cron, Sunday can be 0 or 7. '0 0 * * 0' and '0 0 * * 7' both mean midnight on Sunday.
What does the cron expression '15 14 1 * *' do in Airflow?
ARuns every day at 2:15 PM
BRuns at 1:14 PM every day
CRuns every 15 minutes starting at 2 PM
DRuns at 2:15 PM on the first day of every month
✗ Incorrect
Minute=15, hour=14 (2 PM), day of month=1 means first day of each month at 2:15 PM.
How do you express 'every hour' in a cron expression for Airflow?
A* * * * *
B* 0 * * *
C0 * * * *
D0 0 * * *
✗ Incorrect
"0 * * * *" means at minute 0 of every hour, every day.
Which part of the cron expression controls the day of the week in Airflow?
AFifth field
BSecond field
CFirst field
DThird field
✗ Incorrect
The fifth field in a cron expression is for the day of the week (0-6 or SUN-SAT).
Explain how to read a cron expression in Airflow and give an example.
Think of each field as a time unit that controls when the task runs.
You got /7 concepts.
Describe how to schedule a task to run every weekday at 9 AM using a cron expression in Airflow.
Weekdays are Monday to Friday, which are days 1 to 5.
You got /5 concepts.
Practice
(1/5)
1. What does the cron expression 0 12 * * * mean in Airflow scheduling?
easy
A. Run the task every day at 12:00 PM (noon)
B. Run the task every hour at minute 12
C. Run the task every 12 minutes
D. Run the task every day at midnight
Solution
Step 1: Understand cron fields
The expression has five parts: minute, hour, day of month, month, day of week. Here, 0 12 * * * means minute 0, hour 12, any day, any month, any weekday.
Step 2: Interpret the time
Minute 0 and hour 12 means the task runs once daily at 12:00 PM (noon).
Final Answer:
Run the task every day at 12:00 PM (noon) -> Option A
Quick Check:
Minute=0, Hour=12 means noon daily [OK]
Hint: Minute and hour fields show exact run time [OK]
Common Mistakes:
Confusing hour and minute positions
Thinking * means a specific time
Assuming 12 means midnight
2. Which of the following is the correct cron expression to run a task every 15 minutes in Airflow?
easy
A. */15 * * * *
B. 15 * * * *
C. 0 15 * * *
D. * 15 * * *
Solution
Step 1: Understand the meaning of '*/15' in cron
'*/15' in the minute field means every 15 minutes starting at 0.
Step 2: Check other options
15 * * * * runs at minute 15 every hour, 0 15 * * * runs at 3 PM daily, * 15 * * * is invalid because '*' in minute field with 15 in hour is not correct for every 15 minutes.
Final Answer:
*/15 * * * * -> Option A
Quick Check:
*/15 in minutes means every 15 minutes [OK]
Hint: Use '*/number' in minutes for periodic runs [OK]
Common Mistakes:
Using fixed minute instead of interval
Confusing hour and minute fields
Misplacing the slash '/' syntax
3. Given the cron expression 30 6 * * 1-5, when will the Airflow task run?
medium
A. At 6:30 AM every day
B. At 6:00 AM every weekday
C. At 6:30 PM Monday through Friday
D. At 6:30 AM Monday through Friday
Solution
Step 1: Decode each cron field
Minute=30, Hour=6, Day of month=any, Month=any, Day of week=1-5 (Monday to Friday).
Step 2: Interpret the schedule
The task runs at 6:30 AM on weekdays (Monday to Friday).
Final Answer:
At 6:30 AM Monday through Friday -> Option D
Quick Check:
Day of week 1-5 means weekdays [OK]
Hint: Day of week 1-5 means Monday to Friday [OK]
Common Mistakes:
Mixing AM and PM hours
Ignoring day of week range
Assuming day of month restricts schedule
4. You wrote the cron expression 60 24 * * * in Airflow to run a task daily. What is the problem?
medium
A. It runs every 60 minutes and 24 hours
B. It will run correctly at midnight
C. Minute 60 and hour 24 are invalid values
D. It runs only on the 60th day of the month
Solution
Step 1: Check valid ranges for cron fields
Minute must be 0-59, hour must be 0-23. Here, 60 and 24 are out of range.
Step 2: Understand impact of invalid values
Using invalid values causes syntax errors or the schedule will not run as expected.
Final Answer:
Minute 60 and hour 24 are invalid values -> Option C
Quick Check:
Minute max=59, Hour max=23 [OK]
Hint: Minutes max 59, hours max 23 in cron [OK]
Common Mistakes:
Using 60 for minutes instead of 0
Using 24 for hour instead of 0
Assuming cron accepts out-of-range values
5. You want to schedule an Airflow DAG to run at 11:45 PM on the last day of every month. Which cron expression should you use?
hard
A. 45 23 31 * *
B. 45 23 L * *
C. 45 23 * * 31
D. 45 23 * * L
Solution
Step 1: Understand 'L' in cron expressions
'L' means the last day of the month in the day-of-month field.
Step 2: Check each option
45 23 31 * * runs only on 31st (not all months have 31 days). 45 23 L * * uses 'L' in day-of-month field correctly. 45 23 * * 31 uses 31 in day-of-week field (invalid). 45 23 * * L uses 'L' in day-of-week field (invalid).
Final Answer:
45 23 L * * -> Option B
Quick Check:
'L' in day-of-month means last day [OK]
Hint: Use 'L' in day-of-month for last day of month [OK]
Common Mistakes:
Using 31 for all months (fails in shorter months)
Placing 'L' in wrong cron field
Confusing day-of-week and day-of-month fields
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.