Log inBook a Demo
BuildMidBackendAuto-graded

Fix a cron parser that misses scheduled runs

Rewards exhaustiveness with fiddly scheduling rules, where one unhandled case means a job never runs and nobody notices.The job scheduler decides when a job fires from a standard five-field cron expression, and the core of it is next_run(expr, after): given an expression and a current time, return the next time the job should run. The shipped version is close but wrong in three ways, which show up in production as missed runs and duplicated runs.
35 min
python

You're done when

  • The reference expressions produce the expected next run times.
  • The result is strictly after the given time, so a job never re-fires for the instant it just ran.
  • Step values on a wildcard field are applied correctly.
  • Step values on a range are applied correctly.
  • Behaviour matches a reference implementation across a broad set of expressions and times.

What it measures

Algorithm designComputing the next matching instant across several interacting fields without brute-forcing every second.
Test case designTesting against a reference oracle rather than a few familiar expressions, since the bugs live in the combinations.
Strictness at boundariesGetting strictly-after right, which is the difference between a job running once and running twice.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

35 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo