Skip to content

Instantly share code, notes, and snippets.

@rajivm
rajivm / interview-cron.md
Last active November 11, 2021 22:41 — forked from kjhangiani/interview-cron.md
CRON to Dates API Endpoint

Cron2Date Parser

Summary

Create an API endpoint that accepts a json payload of cron strings, and returns a json payload of valid dates for these strings. Include any applicable tests for this endpoint using the testing platform of your choice.

Details

Frequency Object

A 'frequency' is an object that contains two attributes: name <string> and crons <Array> The crons property is a javascript array of strings (with cron format of "* * * * * *" representing "[sec] [min] [hr] [date] [month] [day of week]"). The following is an array of frequency objects.