After a daylight-saving change, a 02:30 job ran twice on one day and not at all on another. How do you prevent this?
IntermediateScenarioScenarios: text processing and scheduling decisions
Answer
Situation read → In time zones with DST, 02:30 does not exist on the spring-forward day and occurs twice on the fall-back day. Cron implementations handle this differently.
What I'd do →
- Run servers in UTC (
timedatectl set-timezone UTC), which has no DST. - If a local time is a business requirement, use
OnCalendar=*-*-* 02:30:00 UTCstyle explicit zones, or schedule outside the 01:00–03:00 window. - Make the job idempotent (date-stamped outputs, "already done today" check) so a double run is harmless.
Why → DST bugs only appear twice a year, which makes them hard to catch in testing.
Interview tip → Say "servers run in UTC" as a standard, and convert to local time only for display.
More on Scenarios: text processing and scheduling decisions
Users report errors in the last hour. From the Nginx access log, find which endpoints produce the most 5xx responses.BeginnerA MySQL slow log is 3 GB. You need the 10 slowest query patterns. What do you do?IntermediateTwo servers that should be identical behave differently. Compare their installed packages.BeginnerFind which pods were OOMKilled in a namespace, with their container names and restart counts.IntermediateProduce a CSV of running EC2 instances that are missing an `Owner` tag.IntermediateYou have access logs from five web servers and need one timeline sorted by time. How?Intermediate