Startup VO Interview Coding Question: Implement get_available_slots(raw_slots)

74 Views
No Comments

Part 1 – Parse and Validate: Remove slots with missing fields, invalid ISO timestamps, or durations other than exactly 10 minutes.

Part 2 – Aggregate: Group consecutive valid 10-minute slots from the same provider and appointment type into bookable 30-minute blocks.

Overall: Implement get_available_slots(raw_slots) to return clean, valid, and bookable appointment availability without assuming the input is sorted.

This problem focuses on validating appointment-slot data and aggregating it into bookable availability. You first filter out malformed records, invalid ISO timestamps, and any slot whose duration is not exactly 10 minutes. Then, for the same provider and appointment type, you merge consecutive valid 10-minute slots into bookable 30-minute blocks. Because the input is not guaranteed to be sorted, sorting by time before scanning is an important part of the solution.

END
 0