Design Calendar Client State and Recurrence
Design a calendar frontend that keeps day, week, and month views coherent across event creation, deletion, recurring series, and one-occurrence rescheduling.
Problem statement
For this exercise, assume an authenticated, versioned calendar backend already exists. Design the frontend architecture, API contracts, component boundaries, client state, and data flow for day, week, and month views.
Users create and delete standalone or recurring events, switch between views and date ranges, and reschedule one occurrence without moving the rest of its series.
The backend returns bounded materialized occurrences for a requested time window and preserves a stable series identity plus an original-occurrence key for every exception. Mutations use a stable command identity and an expected event or series version, and return the authoritative updated entities or a conflict.
The client may render an optimistic change, but stale fetches, failed mutations, overlapping requests, and view changes must never silently restore deleted state or apply an old occurrence over a newer exception.
Recurrence uses an event's named time zone so a local wall-clock schedule remains meaningful across daylight-saving changes. Focus on frontend ownership, normalized state, derived view projections, caching, request coordination, optimistic reconciliation, and user-visible failure states.
Backend storage internals, invitations, free-busy search, room booking, offline editing, and live multi-user collaboration are outside scope.
What to build
- A user can switch among day, week, and month views and navigate date ranges while seeing one coherent projection of the currently selected window.
- A user can create a standalone event or a recurring series and see the accepted result in every affected cached view.
- A user can delete a standalone event, one occurrence, or an entire recurring series with an explicit scope and visible success or failure.
- A user can move one occurrence of a recurring series without changing the series rule or the other occurrences.
- The frontend reconciles optimistic changes, stale reads, conflicts, retries, and navigation races without silently losing an accepted mutation or resurrecting deleted state.
At scale
- For this exercise, assume a range response contains at most 5,000 materialized occurrences, and the frontend virtualizes dense views rather than mounting every event at once.
- For this exercise, assume a cached view switch or date navigation should become interactive within 100 milliseconds, while a healthy network refresh should settle within one second at p95.
- For this exercise, assume healthy create, delete, and reschedule commands receive an authoritative response within 500 milliseconds at p95.
- For this exercise, assume the client may keep twelve weeks of occurrence windows in an evictable cache and must tolerate overlapping fetches and mutations across those windows.
- For this exercise, assume a stable command identity remains retryable for 24 hours and every accepted response includes an authoritative version.