NEW
Font size
WorksheetsNodeJs: Cron jobs
Total questions: 10
Worksheet time: 5mins
What is a cron job in the context of Node.js?
A web server
A scheduled task
An asynchronous function
A database query
Which npm package is commonly used for scheduling cron jobs in Node.js?
express
mongoose
node-schedule
nodemon
What is the purpose of a cron expression in Node.js?
To define a function
To specify a time schedule
To handle errors
To declare variables
In a cron expression, what does "0 0 ***" represent?
Every minute
Every hour
Every midnight
Every second
What is a recommended approach for testing cron jobs in a Node.js project?
Using unit tests for the scheduled function
Manually running the cron job and checking the logs
Running integration tests
All of the options
Every 15 minutes, we want to check the users that just signed up on our platform. Which expression can we use?
*/15 * * * *
* */15 * * *
* * */15 * *
* * * */15 *
We have written our cron job task in main.js. How do we start the process for the cron job
node-schedule main.js
schedule main.js
node main.js
npm start:main
* * * * *
What does the first asterisk signify
days
hours
weeks
minutes
What would be the expression for at every half hour
*/60 * * * *
*/30 * * * *
* */60 * * *
* */30 * * *
One of the following is not suitable for cron jobs
Data cleanups
Renewing subscriptions
Uploading/Processing images or videos
System maintenance
