Advertisement
Interview Question
What does the cron expression "0 2 * * 1-5" mean, and how would you test a cron job locally?
Key Points to Cover
- "0 2 * * 1-5" runs at 02:00 Monday–Friday
- Fields: min hour dom month dow
- Test via `crontab -l`, `cron` logs, or run the script directly with a dry run flag
Evaluation Rubric
Parses cron fields correctly40% weight
Explains the schedule accurately30% weight
Mentions safe testing approaches30% weight
Hints
- 💡Remember DOW ranges and local time considerations.
Common Pitfalls to Avoid
- ⚠️Misinterpreting the day of week values (e.g., confusing 0/7 for Sunday or swapping Monday-Friday range).
- ⚠️Failing to clearly explain what each of the five fields (minute, hour, day of month, month, day of week) represents.
- ⚠️Not specifying 'AM' when interpreting the hour field, or generally lacking precision in the time component.
- ⚠️Confusing the 'day of month' field with the 'day of week' field, or vice versa.
- ⚠️Only providing the final interpretation without breaking down how each component contributes to the schedule.
Potential Follow-up Questions
- ❓How do you ensure idempotency?
- ❓What about timezone handling in cron?
Advertisement
Ready to prove your AWS DevOps knowledge?
Practice with free DevOps Engineer Professional (DOP-C02) exam questions. Instant answers and detailed explanations — no account required.
Start free practice quizRelated Questions
Questions that share similar topics with this one
CI vs CD vs CD
Beginner📞 Phone Screen•2 min•Phone
Check Disk Space in Linux
Beginner📞 Phone Screen•1 min•Phone
SSH Keys vs Password Authentication
Beginner📞 Phone Screen•1 min•Phone
Find Top CPU Processes in Linux
Beginner📞 Phone Screen•1 min•Phone
Troubleshooting High Memory in Linux
Intermediate📞 Phone Screen•2 min•Phone
Related Articles
Deepen your knowledge with these related blog posts
Taming Toil: Eliminating Repetitive Work to Scale SRE Teams
Toil kills engineering velocity and burns out teams. Learn how to measure, reduce, and automate toil in SRE and DevOps environments — with actionable best practices, anti-patterns, and case studies.
18 min read
Real-Time Monitoring with eBPF: Low-Overhead Insights for Linux & K8s
eBPF is reshaping observability by enabling low-overhead, high-fidelity monitoring directly from the Linux kernel. Learn how it works, practical use cases, and tooling for real-time insights.
15 min read