Sign in to run and submit your work
Reading is open to everyone. Running code and saving drafts need an account so your work is yours and comes back on your next visit.
or
CODE WORKSPACE
A daily job writes one partition per day into object storage. When it fails and nobody notices, the gap is invisible: every query still returns rows, just fewer than there should be. The audit job lists the partitions that exist and has to report the days that do not.
Write missing_dates(dates, start, end). Return the missing days, oldest first.
Function to write
missing_dates(dates: list[str], start: str, end: str) -> list[str]The days in the closed range with no partition, as ISO strings, ascending.
How to approach it
Put the partitions in a set, then walk the range one day at a time and ask.
Sample cases
+ 2 held back until you submit
a month with gaps
Unsorted partitions, one repeated, one before the range, one unparseable and one badly padded.
Input
Argument 1
[
'2026-03-04',
'2026-03-01',
'2026-03-04',
'2026-02-27',
'2026-03-06',
'not a date',
'2026-03-1'
]Argument 2
'2026-03-01'Argument 3
'2026-03-07'Returns
[
'2026-03-02',
'2026-03-03',
'2026-03-05',
'2026-03-07'
]no partitions at all
An empty landing zone means every day in the range is missing.
Input
Argument 1
[] (empty list)
Argument 2
'2026-03-01'Argument 3
'2026-03-03'Returns
[
'2026-03-01',
'2026-03-02',
'2026-03-03'
]a complete range
Every day is covered, so the answer is an empty list rather than None.
Input
Argument 1
[
'2026-03-01',
'2026-03-02'
]Argument 2
'2026-03-01'Argument 3
'2026-03-02'Returns
[] (empty list)
Constraints
start and end are days that must be covered.2026-03-01. A value that is not a string, is blank, or does not parse is not a partition and is ignored.end before the start describes no days at all, so the answer is an empty list — and the loop must terminate.start or end cannot be parsed, return an empty list rather than guessing at the range.Worked example
The listing contains 2026-03-04 twice and 2026-02-27 from before the range. Neither matters: the answer is driven by walking the range and asking whether each day is present, not by walking the listing. Over 2026-03-01 to 2026-03-07 the days missing are the 2nd, 3rd, 5th and 7th.
2026-03-1 looks like a date and is not one — ISO days are zero-padded, so it fails to parse and is ignored. That means the 1st is reported as missing unless the correctly written 2026-03-01 is also in the listing, which it is. Treating the malformed value as if it were the 1st would be a guess, and the audit job exists precisely to avoid guessing.
What this tests
Driving the answer from the range rather than from the data. Every version that iterates the partitions can only report days it has already seen, which is the one thing a completeness check must not do.
missing_dates(dates: list[str], start: str, end: str) -> list[str]Submit for review to find out what your query gets right, what it gets wrong, and how it compares with the best working query for this exercise.
This scenario runs a full workspace — editor, canvas and results side by side. It needs a laptop or desktop to be usable. Open this page on a bigger screen to start building.