Interview Preparation

Cron Interview Questions

These questions cover syntax, debugging, platforms, reliability, and practical cron reasoning for developer and DevOps interviews.

20 cron interview questions and answers

  • What are the five fields in Linux cron? Minute, hour, day of month, month, and day of week.
  • What does * * * * * mean? It runs every minute.
  • What does */5 * * * * mean? It runs every five minutes.
  • How do you run a job every weekday at 9 AM? Use 0 9 * * 1-5.
  • What is the valid hour range? 0 through 23.
  • What is the valid minute range? 0 through 59.
  • What does 0 0 1 * * mean? Midnight on the first day of every month.
  • How do you edit a user crontab? Use crontab -e.
  • How do you list user cron jobs? Use crontab -l.
  • Why should cron scripts use absolute paths? Cron has a limited environment.
  • How do you capture cron output? Redirect stdout and stderr to a log file.
  • How do you avoid overlapping jobs? Use locks or platform concurrency controls.
  • What timezone does GitHub Actions schedule use? UTC.
  • What is different about Quartz cron? It usually has seconds and extra special characters.
  • What does Jenkins H do? It distributes schedules with stable hashing.
  • What Kubernetes resource runs scheduled jobs? CronJob.
  • What does concurrencyPolicy: Forbid do? It prevents overlapping Kubernetes CronJobs.
  • Why test cron expressions before production? Small syntax mistakes can silently miss jobs.
  • What is a common AWS EventBridge cron difference? AWS uses a different field format and UTC behavior.
  • How would you debug a cron job that did not run? Check syntax, logs, environment, permissions, and timezone.

Practical practice

Practice by writing an expression, validating it, explaining it, and checking upcoming run times before reading the answer.

0 9 * * 1-5
*/10 8-18 * * *
30 18 * * 5

Common mistakes

  • Memorizing examples without understanding field order.
  • Ignoring platform-specific cron differences.
  • Skipping operational concerns such as logs and retries.

FAQ

How should I practice cron for interviews?

Use the Generator, Explainer, Validator, and Playground to connect syntax with behavior.

Do interviews ask platform-specific cron?

DevOps interviews often ask about Linux cron, Kubernetes CronJobs, Jenkins schedules, and GitHub Actions schedules.