Problem
Design the frontend of Google Calendar: day, week and month views of events from several calendars, where people create, move and resize events by dragging, many events repeat, and everyone sees each event at the right time in their own time zone.
It tests how you handle time in the browser: recurring events and the single occurrences people change, time zones and daylight saving time, laying out overlapping events, and keeping a large interactive grid fast, correct and up to date.
Functional requirements
- See events in day, week and month views (plus a schedule list), across several calendars.
- Create, move and resize events by dragging on the grid or with a form, and change a recurring event for one occurrence, for this and following occurrences, or for all of them.
- Get reminders before events, and see other people's changes without refreshing.
Constraints
- Up to about 25 calendars shown at once, about 1,500 events in a month view, and events that repeat forever.
- Moving to another week, or creating or moving an event, shows on screen in under 100 ms, and dragging runs at 60 frames per second.
- Every event shows at the right time in every time zone and across daylight saving time changes.
- Other people's changes appear within a few seconds, reminders fire within a minute of their time, and no edit is lost on a flaky connection or while offline.
- Works with mouse and touch, and is accessible to WCAG 2.2 AA: keyboard, screen reader, and an alternative to every drag.
Discussion areas
- Core entities and key actions: what calendars, events, recurring events and reminders are, and which user actions shape the design.
- Architecture: rendering approach, the layers between UI components and the server, the component tree, and where date and time logic should live.
- Data model: how to represent recurring events and the single occurrences people change, and how to store event times.
- Time zones and daylight saving time: how a repeating meeting should behave when clocks change, and what an all-day event means across zones.
- Loading and caching: which events to fetch for the dates on screen, how to reuse them while navigating, and how to stay in sync.
- API and live updates: endpoints for loading and editing, and how other people's changes reach an open calendar.
- Editing recurring events: what "this event", "this and following events" and "all events" should each do.
- Overlapping events: laying out a busy day in the week grid and a crowded day in the month grid.
- Writes, conflicts and offline: showing a drag instantly, two people editing the same meeting, failed requests, and edits made offline.
- Reminders, performance and accessibility: notifications with and without an open tab, a smooth drag, and using the calendar without a mouse.
Follow-up questions interviewers ask
- Why not let the server expand recurring events into single instances?
- What happens to changed occurrences when someone edits "all events"?
- Why store a UTC time and a time zone, instead of just UTC?
- What happens on the day the clocks go back, when one hour happens twice?
- How do all-day events work across time zones?
- What if a country changes its daylight saving rules?
- Why can't the page schedule a reminder that fires after the tab is closed?
- How do several open tabs work?