Which of the following is a valid schedule for a CronJob that runs every day at midnight?
The five-field cron format is minute, hour, day-of-month, month, day-of-week. All zeros in the first two fields mean minute zero of hour zero, i.e. midnight daily, while the asterisks leave every day and month unrestricted.
Why this answer
A CronJob schedule uses standard cron syntax: minute, hour, day of month, month, day of week. '0 0 * * *' means minute=0, hour=0 (midnight), and the asterisks for day of month, month, and day of week match any value, so the job runs every day at midnight.
Exam trap
A common trap is the subtle difference between '0 0 * * *' (every day at midnight) and '0 0 1 * *' (first day of the month at midnight), exploiting the confusion that the third field is day of month, not 'every day'.
How to eliminate wrong answers
Option A is wrong because '0 0 1 * *' runs at midnight on the first day of every month, not every day. Option B is wrong because '* * * * *' runs every minute, which is not 'every day at midnight'. Option C is wrong because '0 * * * *' runs at the start of every hour (minute 0 of every hour), not specifically at midnight.