Loading...
Functional Requirements:
Non-Functional Requirements:
1. Schedule a Meeting POST /v1/events
JSON
{
"title": "System Design Interview",
"attendeeIds": ["user-1", "user-2", "user-3"],
"startTime": "2026-03-05T14:00:00Z", // Always UTC
"endTime": "2026-03-05T15:00:00Z"
}
2. Suggest Alternative Times POST /v1/events/suggestions
JSON
{
"attendeeIds": ["user-1", "user-2"],
"durationMinutes": 60,
"dateRangeStart": "2026-03-05T00:00:00Z",
"dateRangeEnd": "2026-03-10T00:00:00Z"
}
Events.Here is how we solve the heavy algorithmic lifting without pre-computing 90 days of slots.
1. Conflict Detection & Alternative Suggestions (The Algorithm)
When a user asks for a 60-minute slot for 5 attendees over a 5-day period, we treat this purely as an Interval Merging problem.
Events for those 5 users within the 5-day window. (e.g., SELECT * FROM Events WHERE userId IN (...) AND timeRange && [5-day-window]).durationMinutes (60 mins), discard it. The remaining blocks are your perfectly calculated alternative suggestions.2. Calendar Integration (Two-Way Sync)
Integrating with Google and Outlook is notoriously complex due to rate limits and pagination.
3. The Time Zone Golden Rule
Time zones are the fastest way to introduce catastrophic bugs in a scheduling system. The architecture must enforce a strict boundary:
Z).